-
Notifications
You must be signed in to change notification settings - Fork 30
ConvertTo WinSCPEscapedString
Thomas Malkewitz edited this page Aug 9, 2019
·
20 revisions
Converts special characters in file path to make it unambiguous file mask/wildcard.
ConvertTo-WinSCPEscapedString -FileMask <String[]> [<CommonParameters>]
Converts special characters in file path to make it unambiguous file mask/wildcard.
PS C:\> ConvertTo-WinSCPEscapedString -FileMask "./WhosFileIsThis?.txt"
./WhosFileIsThis[?].txt
PS C:\> $sessionOption = New-WinSCPSessionOption -HostName $env:COMPUTERNAME -Protocol Ftp
PS C:\> New-WinSCPSession -SessionOption $sessionOption
Opened Timeout HostName
------ ------- --------
True 00:01:00 ftp.dotps1.github.io
PS C:\> $escapedString = ConvertTo-WinSCPEscapedString -FileMask "./WhosFileIsThis?.txt"
PS C:\> Get-WinSCPItem -Path $escapedString
Directory: ./
Mode LastWriteTime Length Name
---- ------------- ------ ----
--------- 4/25/2017 11:30:02 AM 349 WhosFileIsThis?.txt
PS C:\> Remove-WinSCPSession
See WinSCP Documentation for filemasks and usages: https://winscp.net/eng/docs/file_mask.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.