initial Commit
This commit is contained in:
19
Private/ConvertTo-ConfigurationDataSafeName.ps1
Normal file
19
Private/ConvertTo-ConfigurationDataSafeName.ps1
Normal file
@@ -0,0 +1,19 @@
|
||||
function ConvertTo-ConfigurationDataSafeName {
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[AllowNull()]
|
||||
[string]
|
||||
$Value,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]
|
||||
$Separator
|
||||
)
|
||||
|
||||
if($null -eq $Value){
|
||||
return ""
|
||||
}
|
||||
|
||||
$SafeName = [regex]::Replace($Value.Trim(), "[^A-Za-z0-9_-]+", $Separator)
|
||||
return Normalize-ConfigurationDataSeparator -Value $SafeName -Separator $Separator
|
||||
}
|
||||
Reference in New Issue
Block a user