Initial Commit

This commit is contained in:
Tyler Hale 2024-12-04 11:18:29 -07:00
commit aba605f60a
Signed by: Tyler
GPG key ID: C7CC4B910D88EF96

View file

@ -0,0 +1,14 @@
Function Remove-InvalidCharacters {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]
$String,
[Parameter(Mandatory=$false)]
$ReplacementCharacter = ''
)
$InvalidCharacters = [RegEx]::Escape(-join $([System.IO.Path]::GetInvalidFileNameChars()))
return [RegEx]::Replace($String, "[$InvalidCharacters]", $ReplacementCharacter)
}