Converts the special characters in string.
ConvertTo-WinSCPEscapedString [-FileMask] <String[]> [<CommonParameters>]
Escapes special characters so they are not misinterpreted as wildcards or other special characters.
File path to convert.
CommonParameters <CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
Useful with Send-WinSCPItem, Receive-WinSCPItem, Remove-WinSCPItem cmdlets.
PS C:\> ConvertTo-WinSCPEscapedString -FileMask 'FileWithA*InName.txt'
FileWithA[*]InName.txt
PS C:\> $credential = Get-Credential
PS C:\> $session = New-WinSCPSession -Credential $credential -Hostname 'myftphost.org' -SshHostKeyFingerprint 'ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx'
PS C:\> $fileName = ConvertTo-WinSCPEscapedString -FileMask 'FileWithA*InName.txt'
PS C:\> Receive-WinSCPItem -WinSCPSession $session -RemoteItem "/rDir/$fileName" -LocalItem 'C:\lDir\'
Transfers Failures IsSuccess
--------- -------- ---------
{/rDir/FileWithA*InName.txt} {} True