From dc786540009b106dbfbd8b59434841a2f8bbfd97 Mon Sep 17 00:00:00 2001 From: Thomas Malkewitz Date: Thu, 21 Jun 2018 14:51:35 -0400 Subject: [PATCH] Build - Update WinSCP Core to 5.13.3. Bug fixes for #76, #78, and #79. Added new cmdlet Copy-WinSCPItem. Simplified path validation in Move-WinSCPItem. --- Help/ConvertTo-WinSCPEscapedString.md | 5 +- Help/Copy-WinSCPItem.md | 160 +++++++++++ Help/Get-WinSCPChildItem.md | 5 +- Help/Get-WinSCPHostKeyFingerprint.md | 5 +- Help/Get-WinSCPItem.md | 5 +- Help/Get-WinSCPItemChecksum.md | 5 +- Help/Get-WinSCPSession.md | 5 +- Help/Invoke-WinSCPCommand.md | 5 +- Help/Move-WinSCPItem.md | 5 +- Help/New-WinSCPItem.md | 5 +- Help/New-WinSCPItemPermission.md | 5 +- Help/New-WinSCPSession.md | 5 +- Help/New-WinSCPSessionOption.md | 37 +-- Help/New-WinSCPTransferOption.md | 5 +- Help/New-WinSCPTransferResumeSupport.md | 5 +- Help/Receive-WinSCPItem.md | 5 +- Help/Remove-WinSCPItem.md | 5 +- Help/Remove-WinSCPSession.md | 5 +- Help/Rename-WinSCPItem.md | 5 +- Help/Send-WinSCPItem.md | 5 +- Help/Start-WinSCPConsole.md | 5 +- Help/Sync-WinSCPPath.md | 5 +- Help/Test-WinSCPPath.md | 5 +- Tests/Copy-WinSCPItem.Tests.ps1 | 15 + Tests/New-WinSCPItemPermission.Tests.ps1 | 2 +- Tests/New-WinSCPSession.Tests.ps1 | 2 +- Tests/New-WinSCPSessionOption.Tests.ps1 | 2 +- Tests/New-WinSCPTransferOption.Tests.ps1 | 2 +- .../New-WinSCPTransferResumeSupport.Tests.ps1 | 2 +- Tests/Receive-WinSCPItem.Tests.ps1 | 2 +- Tests/Remove-WinSCPItem.Tests.ps1 | 2 +- Tests/Remove-WinSCPSession.Tests.ps1 | 2 +- Tests/Rename-WinSCPItem.Tests.ps1 | 2 +- Tests/Send-WinSCPItem.Tests.ps1 | 2 +- Tests/Start-WinSCPConsole.Tests.ps1 | 2 +- Tests/Sync-WinSCPPath.Tests.ps1 | 2 +- Tests/Test-WinSCPPath.Tests.ps1 | 2 +- WinSCP/Public/Copy-WinSCPItem.ps1 | 87 ++++++ WinSCP/Public/Move-WinSCPItem.ps1 | 23 +- WinSCP/Public/New-WinSCPSessionOption.ps1 | 8 +- WinSCP/Public/Remove-WinSCPItem.ps1 | 3 +- WinSCP/WinSCP.psd1 | 2 + WinSCP/en-US/WinSCP-Help.xml | 272 ++++++++++++++++-- docs/CONTRIBUTING.md | 2 +- 44 files changed, 627 insertions(+), 113 deletions(-) create mode 100644 Help/Copy-WinSCPItem.md create mode 100644 Tests/Copy-WinSCPItem.Tests.ps1 create mode 100644 WinSCP/Public/Copy-WinSCPItem.ps1 diff --git a/Help/ConvertTo-WinSCPEscapedString.md b/Help/ConvertTo-WinSCPEscapedString.md index 8b24aef..63bde8c 100644 --- a/Help/ConvertTo-WinSCPEscapedString.md +++ b/Help/ConvertTo-WinSCPEscapedString.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/ConvertTo-WinSCPEscapedString schema: 2.0.0 @@ -70,7 +70,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Copy-WinSCPItem.md b/Help/Copy-WinSCPItem.md new file mode 100644 index 0000000..9035f11 --- /dev/null +++ b/Help/Copy-WinSCPItem.md @@ -0,0 +1,160 @@ +--- +external help file: WinSCP-help.xml +Module Name: WinSCP +online version: https://github.com/dotps1/WinSCP/wiki/Copy-WinSCPItem +schema: 2.0.0 +--- + +# Copy-WinSCPItem + +## SYNOPSIS +{{Fill in the Synopsis}} + +## SYNTAX + +``` +Copy-WinSCPItem -WinSCPSession [-Path] [-Destination ] [-Force] [-PassThru] + [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +{{Fill in the Description}} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Destination +{{Fill Destination Description}} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +{{Fill Force Description}} + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +{{Fill PassThru Description}} + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Path +{{Fill Path Description}} + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WinSCPSession +{{Fill WinSCPSession Description}} + +```yaml +Type: Session +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### WinSCP.Session +System.String[] + + +## OUTPUTS + +### System.Void + + +## NOTES + +## RELATED LINKS + +[https://github.com/dotps1/WinSCP/wiki/Copy-WinSCPItem](https://github.com/dotps1/WinSCP/wiki/Copy-WinSCPItem) + diff --git a/Help/Get-WinSCPChildItem.md b/Help/Get-WinSCPChildItem.md index 837d92b..43cc5e5 100644 --- a/Help/Get-WinSCPChildItem.md +++ b/Help/Get-WinSCPChildItem.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Get-WinSCPChildItem schema: 2.0.0 @@ -186,7 +186,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Get-WinSCPHostKeyFingerprint.md b/Help/Get-WinSCPHostKeyFingerprint.md index 67116fa..639c662 100644 --- a/Help/Get-WinSCPHostKeyFingerprint.md +++ b/Help/Get-WinSCPHostKeyFingerprint.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Get-WinSCPServerPublicKeyFingerprint schema: 2.0.0 @@ -94,7 +94,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Get-WinSCPItem.md b/Help/Get-WinSCPItem.md index a7ee550..0fc6333 100644 --- a/Help/Get-WinSCPItem.md +++ b/Help/Get-WinSCPItem.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Get-WinSCPItem schema: 2.0.0 @@ -105,7 +105,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Get-WinSCPItemChecksum.md b/Help/Get-WinSCPItemChecksum.md index 1860dd5..c8a2516 100644 --- a/Help/Get-WinSCPItemChecksum.md +++ b/Help/Get-WinSCPItemChecksum.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Get-WinSCPItemChecksum schema: 2.0.0 @@ -78,7 +78,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Get-WinSCPSession.md b/Help/Get-WinSCPSession.md index 39bed2d..6f4d8bd 100644 --- a/Help/Get-WinSCPSession.md +++ b/Help/Get-WinSCPSession.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Get-WinSCPSession schema: 2.0.0 @@ -48,7 +48,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Invoke-WinSCPCommand.md b/Help/Invoke-WinSCPCommand.md index 21fae25..e263fd5 100644 --- a/Help/Invoke-WinSCPCommand.md +++ b/Help/Invoke-WinSCPCommand.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Invoke-WinSCPCommand schema: 2.0.0 @@ -61,7 +61,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Move-WinSCPItem.md b/Help/Move-WinSCPItem.md index f1cafca..cbd46ae 100644 --- a/Help/Move-WinSCPItem.md +++ b/Help/Move-WinSCPItem.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Move-WinSCPItem schema: 2.0.0 @@ -160,7 +160,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/New-WinSCPItem.md b/Help/New-WinSCPItem.md index c077c4e..f3a3fcf 100644 --- a/Help/New-WinSCPItem.md +++ b/Help/New-WinSCPItem.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/New-WinSCPItem schema: 2.0.0 @@ -199,7 +199,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/New-WinSCPItemPermission.md b/Help/New-WinSCPItemPermission.md index 668915f..4f03433 100644 --- a/Help/New-WinSCPItemPermission.md +++ b/Help/New-WinSCPItemPermission.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/New-WinSCPItemPermission schema: 2.0.0 @@ -328,7 +328,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/New-WinSCPSession.md b/Help/New-WinSCPSession.md index cc5fb0f..410a7d4 100644 --- a/Help/New-WinSCPSession.md +++ b/Help/New-WinSCPSession.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/New-WinSCPSession schema: 2.0.0 @@ -194,7 +194,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/New-WinSCPSessionOption.md b/Help/New-WinSCPSessionOption.md index 40f40c2..9321af5 100644 --- a/Help/New-WinSCPSessionOption.md +++ b/Help/New-WinSCPSessionOption.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/New-WinSCPSessionOption schema: 2.0.0 @@ -15,7 +15,7 @@ Defines information to allow an automatic connection and authentication of the s ``` New-WinSCPSessionOption [[-Credential] ] [[-FtpMode] ] [[-FtpSecure] ] [-GiveUpSecurityAndAcceptAnySshHostKey] [-GiveUpSecurityAndAcceptAnyTlsHostCertificate] [-HostName] - [[-PortNumber] ] [[-PrivateKeyPassphrase] ] [[-Protocol] ] + [[-PortNumber] ] [[-Protocol] ] [-SecurePrivateKeyPassphrase ] [[-SshHostKeyFingerprint] ] [[-SshPrivateKeyPath] ] [[-TlsClientCertificatePath] ] [[-TlsHostCertificateFingerprint] ] [[-Timeout] ] [-WebdavSecure] [[-WebdavRoot] ] [[-RawSetting] ] [-WhatIf] [-Confirm] [] @@ -200,21 +200,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -PrivateKeyPassphrase -Passphrase for encrypted private keys and client certificates. - -```yaml -Type: SecureString -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Protocol Protocol to use for the session. Possible values are Protocol.Sftp (default), Protocol.Scp, Protocol.Ftp and Protocol.Webdav. @@ -385,8 +370,24 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -SecurePrivateKeyPassphrase +{{Fill SecurePrivateKeyPassphrase Description}} + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/New-WinSCPTransferOption.md b/Help/New-WinSCPTransferOption.md index 3b39fe9..cdce1ac 100644 --- a/Help/New-WinSCPTransferOption.md +++ b/Help/New-WinSCPTransferOption.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/New-WinSCPTransferOption schema: 2.0.0 @@ -199,7 +199,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/New-WinSCPTransferResumeSupport.md b/Help/New-WinSCPTransferResumeSupport.md index 0d70f68..6a6055b 100644 --- a/Help/New-WinSCPTransferResumeSupport.md +++ b/Help/New-WinSCPTransferResumeSupport.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/New-WinSCPTransferResumeSupport schema: 2.0.0 @@ -96,7 +96,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Receive-WinSCPItem.md b/Help/Receive-WinSCPItem.md index 7bac0e9..6272349 100644 --- a/Help/Receive-WinSCPItem.md +++ b/Help/Receive-WinSCPItem.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Receive-WinSCPItem schema: 2.0.0 @@ -137,7 +137,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Remove-WinSCPItem.md b/Help/Remove-WinSCPItem.md index de058ce..5ef9e63 100644 --- a/Help/Remove-WinSCPItem.md +++ b/Help/Remove-WinSCPItem.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Remove-WinSCPItem schema: 2.0.0 @@ -90,7 +90,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Remove-WinSCPSession.md b/Help/Remove-WinSCPSession.md index ce77ea0..8fd56e2 100644 --- a/Help/Remove-WinSCPSession.md +++ b/Help/Remove-WinSCPSession.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Remove-WinSCPSession schema: 2.0.0 @@ -75,7 +75,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Rename-WinSCPItem.md b/Help/Rename-WinSCPItem.md index 49cfeb5..479eb7c 100644 --- a/Help/Rename-WinSCPItem.md +++ b/Help/Rename-WinSCPItem.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Rename-WinSCPItem schema: 2.0.0 @@ -112,7 +112,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Send-WinSCPItem.md b/Help/Send-WinSCPItem.md index f03963f..40af5c7 100644 --- a/Help/Send-WinSCPItem.md +++ b/Help/Send-WinSCPItem.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Send-WinSCPItem schema: 2.0.0 @@ -139,7 +139,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Start-WinSCPConsole.md b/Help/Start-WinSCPConsole.md index c95c459..f435af7 100644 --- a/Help/Start-WinSCPConsole.md +++ b/Help/Start-WinSCPConsole.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Start-WinSCPConsole schema: 2.0.0 @@ -60,7 +60,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Sync-WinSCPPath.md b/Help/Sync-WinSCPPath.md index 36b7928..8a5adf2 100644 --- a/Help/Sync-WinSCPPath.md +++ b/Help/Sync-WinSCPPath.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Sync-WinSCPPath schema: 2.0.0 @@ -177,7 +177,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Help/Test-WinSCPPath.md b/Help/Test-WinSCPPath.md index a69bed9..f2952c2 100644 --- a/Help/Test-WinSCPPath.md +++ b/Help/Test-WinSCPPath.md @@ -1,5 +1,5 @@ --- -external help file: WinSCP-help.xml +external help file: WinSCP-Help.xml Module Name: WinSCP online version: https://github.com/dotps1/WinSCP/wiki/Test-WinSCPPath schema: 2.0.0 @@ -60,7 +60,8 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/Tests/Copy-WinSCPItem.Tests.ps1 b/Tests/Copy-WinSCPItem.Tests.ps1 new file mode 100644 index 0000000..e3198cc --- /dev/null +++ b/Tests/Copy-WinSCPItem.Tests.ps1 @@ -0,0 +1,15 @@ +#Requires -Modules Pester, PSScriptAnalyzer, WinSCP + +Get-Process -Name WinSCP -ErrorAction SilentlyContinue | + Stop-Process -Force + +Describe "Copy-WinSCPItem" { + Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\Copy-WinSCPItem.ps1`"" { + $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\Copy-WinSCPItem.ps1" + + It "Invoke-ScriptAnalyzer of Copy-WinSCPItem results count should be 0." { + $results.Count | + Should Be 0 + } + } +} diff --git a/Tests/New-WinSCPItemPermission.Tests.ps1 b/Tests/New-WinSCPItemPermission.Tests.ps1 index 3469ec9..57393ac 100644 --- a/Tests/New-WinSCPItemPermission.Tests.ps1 +++ b/Tests/New-WinSCPItemPermission.Tests.ps1 @@ -7,7 +7,7 @@ Describe "New-WinSCPItemPermission" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\New-WinSCPItemPermission.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\New-WinSCPItemPermission.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of New-WinSCPItemPermission results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/New-WinSCPSession.Tests.ps1 b/Tests/New-WinSCPSession.Tests.ps1 index 8849209..b415819 100644 --- a/Tests/New-WinSCPSession.Tests.ps1 +++ b/Tests/New-WinSCPSession.Tests.ps1 @@ -56,7 +56,7 @@ Describe "New-WinSCPSession" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\New-WinSCPSession.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\New-WinSCPSession.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of New-WinSCPSession results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/New-WinSCPSessionOption.Tests.ps1 b/Tests/New-WinSCPSessionOption.Tests.ps1 index f00f198..6355ce0 100644 --- a/Tests/New-WinSCPSessionOption.Tests.ps1 +++ b/Tests/New-WinSCPSessionOption.Tests.ps1 @@ -7,7 +7,7 @@ Describe "New-WinSCPSessionOption" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\New-WinSCPSessionOption.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\New-WinSCPSessionOption.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of New-WinSCPSessionOption results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/New-WinSCPTransferOption.Tests.ps1 b/Tests/New-WinSCPTransferOption.Tests.ps1 index ec2cdea..030da7c 100644 --- a/Tests/New-WinSCPTransferOption.Tests.ps1 +++ b/Tests/New-WinSCPTransferOption.Tests.ps1 @@ -7,7 +7,7 @@ Describe "New-WinSCPTransferOption" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\New-WinSCPTransferOption.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\New-WinSCPTransferOption.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of New-WinSCPTransferOption results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/New-WinSCPTransferResumeSupport.Tests.ps1 b/Tests/New-WinSCPTransferResumeSupport.Tests.ps1 index 7cc7da3..5625073 100644 --- a/Tests/New-WinSCPTransferResumeSupport.Tests.ps1 +++ b/Tests/New-WinSCPTransferResumeSupport.Tests.ps1 @@ -7,7 +7,7 @@ Describe "New-WinSCPTransferResumeSupport" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\New-WinSCPTransferResumeSupport.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\New-WinSCPTransferResumeSupport.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of New-WinSCPTransferResumeSupport results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/Receive-WinSCPItem.Tests.ps1 b/Tests/Receive-WinSCPItem.Tests.ps1 index 0fb3570..e9db465 100644 --- a/Tests/Receive-WinSCPItem.Tests.ps1 +++ b/Tests/Receive-WinSCPItem.Tests.ps1 @@ -72,7 +72,7 @@ Describe "Receive-WinSCPItem" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\Receive-WinSCPItem.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\Receive-WinSCPItem.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of Receive-WinSCPItem results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/Remove-WinSCPItem.Tests.ps1 b/Tests/Remove-WinSCPItem.Tests.ps1 index c2775db..3d97b39 100644 --- a/Tests/Remove-WinSCPItem.Tests.ps1 +++ b/Tests/Remove-WinSCPItem.Tests.ps1 @@ -7,7 +7,7 @@ Describe "Remove-WinSCPItem" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\Remove-WinSCPItem.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\Remove-WinSCPItem.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of Remove-WinSCPItem results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/Remove-WinSCPSession.Tests.ps1 b/Tests/Remove-WinSCPSession.Tests.ps1 index ee8f18d..8a841a4 100644 --- a/Tests/Remove-WinSCPSession.Tests.ps1 +++ b/Tests/Remove-WinSCPSession.Tests.ps1 @@ -8,7 +8,7 @@ Describe "Remove-WinSCPSession" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\Remove-WinSCPSession.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\Remove-WinSCPSession.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of Remove-WinSCPSession results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/Rename-WinSCPItem.Tests.ps1 b/Tests/Rename-WinSCPItem.Tests.ps1 index 9de029b..326d1b8 100644 --- a/Tests/Rename-WinSCPItem.Tests.ps1 +++ b/Tests/Rename-WinSCPItem.Tests.ps1 @@ -7,7 +7,7 @@ Describe "Rename-WinSCPItem" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\Rename-WinSCPItem.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\Rename-WinSCPItem.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of Rename-WinSCPItem results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/Send-WinSCPItem.Tests.ps1 b/Tests/Send-WinSCPItem.Tests.ps1 index c2bdd29..bc49216 100644 --- a/Tests/Send-WinSCPItem.Tests.ps1 +++ b/Tests/Send-WinSCPItem.Tests.ps1 @@ -40,7 +40,7 @@ Describe "Send-WinSCPItem" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\Send-WinSCPItem.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\Send-WinSCPItem.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of Send-WinSCPItem results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/Start-WinSCPConsole.Tests.ps1 b/Tests/Start-WinSCPConsole.Tests.ps1 index 6605d07..bbef8bf 100644 --- a/Tests/Start-WinSCPConsole.Tests.ps1 +++ b/Tests/Start-WinSCPConsole.Tests.ps1 @@ -7,7 +7,7 @@ Describe 'Start-WinSCPConsole' { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\Start-WinSCPConsole.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\Start-WinSCPConsole.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of Start-WinSCPConsole results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/Sync-WinSCPPath.Tests.ps1 b/Tests/Sync-WinSCPPath.Tests.ps1 index 5e21bdb..c065e30 100644 --- a/Tests/Sync-WinSCPPath.Tests.ps1 +++ b/Tests/Sync-WinSCPPath.Tests.ps1 @@ -7,7 +7,7 @@ Describe "Sync-WinSCPPath" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\Sync-WinSCPPath.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\Sync-WinSCPPath.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of Sync-WinSCPPath results count should be 0." { $results.Count | Should Be 0 } diff --git a/Tests/Test-WinSCPPath.Tests.ps1 b/Tests/Test-WinSCPPath.Tests.ps1 index a92afe2..3d53ab1 100644 --- a/Tests/Test-WinSCPPath.Tests.ps1 +++ b/Tests/Test-WinSCPPath.Tests.ps1 @@ -7,7 +7,7 @@ Describe "Test-WinSCPPath" { Context "Invoke-ScriptAnalyzer -Path `"$((Get-Module -Name WinSCP).ModuleBase)\Public\Test-WinSCPPath.ps1`"" { $results = Invoke-ScriptAnalyzer -Path "$((Get-Module -Name WinSCP).ModuleBase)\Public\Test-WinSCPPath.ps1" - It "Invoke-ScriptAnalyzer of New-WinSCPItem results count should be 0." { + It "Invoke-ScriptAnalyzer of Test-WinSCPPath results count should be 0." { $results.Count | Should Be 0 } diff --git a/WinSCP/Public/Copy-WinSCPItem.ps1 b/WinSCP/Public/Copy-WinSCPItem.ps1 new file mode 100644 index 0000000..084bf90 --- /dev/null +++ b/WinSCP/Public/Copy-WinSCPItem.ps1 @@ -0,0 +1,87 @@ +function Copy-WinSCPItem { + + [CmdletBinding( + ConfirmImpact = "Medium", + HelpUri = "https://github.com/dotps1/WinSCP/wiki/Copy-WinSCPItem", + SupportsShouldProcess = $true + )] + [OutputType( + [Void] + )] + + param ( + [Parameter( + Mandatory = $true, + ValueFromPipelineByPropertyName = $true + )] + [ValidateScript({ + if ($_.Opened) { + return $true + } else { + throw "The WinSCP Session is not in an Open state." + } + })] + [WinSCP.Session] + $WinSCPSession, + + [Parameter( + Mandatory = $true, + Position = 0, + ValueFromPipeline = $true, + ValueFromPipelineByPropertyName = $true + )] + [String[]] + $Path, + + [Parameter()] + [String] + $Destination = $WinSCPSession.HomePath, + + [Parameter()] + [Switch] + $Force, + + [Parameter()] + [Switch] + $PassThru + ) + + process { + process { + $Destination = Format-WinSCPPathString -Path $Destination + $destinationInfo = Get-WinSCPItem -WinSCPSession $WinSCPSession -Path $Destination -ErrorAction SilentlyContinue + + foreach ($pathValue in ( Format-WinSCPPathString -Path $Path )) { + try { + $shouldProcess = $PSCmdlet.ShouldProcess( + $pathValue + ) + if ($shouldProcess) { + if ($null -ne $destinationInfo) { + $leaf = Split-Path -Path $pathValue -Leaf + $destinationPath = $WinSCPSession.CombinePaths( + $Destination, $leaf + ) + } + + if (( Test-WinSCPPath -WinSCPSession $WinSCPSession -Path $destinationPath ) -and $Force.IsPresent) { + Remove-WinSCPItem -WinSCPSession $WinSCPSession -Path $destinationPath -Confirm:$false + } + + $WinSCPSession.DuplicateFile( + $pathValue, $destinationPath + ) + } + + if ($PassThru.IsPresent) { + Get-WinSCPItem -WinSCPSession $WinSCPSession -Path $destinationPath + } + } catch { + $PSCmdlet.WriteError( + $_ + ) + } + } + } + } +} diff --git a/WinSCP/Public/Move-WinSCPItem.ps1 b/WinSCP/Public/Move-WinSCPItem.ps1 index 3cb6fac..b5f6fc9 100644 --- a/WinSCP/Public/Move-WinSCPItem.ps1 +++ b/WinSCP/Public/Move-WinSCPItem.ps1 @@ -48,15 +48,7 @@ process { $Destination = Format-WinSCPPathString -Path $Destination - $destinationEndsWithForwardSlash = $Destination.EndsWith( - [System.IO.Path]::AltDirectorySeparatorChar - ) $destinationInfo = Get-WinSCPItem -WinSCPSession $WinSCPSession -Path $Destination -ErrorAction SilentlyContinue - if ($null -ne $destinationInfo) { - if ($destinationInfo.IsDirectory -and -not $destinationEndsWithForwardSlash) { - $Destination += "/" - } - } foreach ($pathValue in ( Format-WinSCPPathString -Path $Path )) { try { @@ -64,13 +56,24 @@ $pathValue ) if ($shouldProcess) { + if ($null -ne $destinationInfo) { + $leaf = Split-Path -Path $pathValue -Leaf + $destinationPath = $WinSCPSession.CombinePaths( + $Destination, $leaf + ) + } + + if (( Test-WinSCPPath -WinSCPSession $WinSCPSession -Path $destinationPath ) -and $Force.IsPresent) { + Remove-WinSCPItem -WinSCPSession $WinSCPSession -Path $destinationPath -Confirm:$false + } + $WinSCPSession.MoveFile( - $pathValue, $Destination + $pathValue, $destinationPath ) } if ($PassThru.IsPresent) { - Get-WinSCPItem -WinSCPSession $WinSCPSession -Path ( Join-Path -Path $Destination -ChildPath ( Split-Path -Path $pathValue -Leaf )) + Get-WinSCPItem -WinSCPSession $WinSCPSession -Path $destinationPath } } catch { $PSCmdlet.WriteError( diff --git a/WinSCP/Public/New-WinSCPSessionOption.ps1 b/WinSCP/Public/New-WinSCPSessionOption.ps1 index 4260488..cb1be1a 100644 --- a/WinSCP/Public/New-WinSCPSessionOption.ps1 +++ b/WinSCP/Public/New-WinSCPSessionOption.ps1 @@ -46,14 +46,14 @@ function New-WinSCPSessionOption { [Int] $PortNumber = 0, - [Parameter()] - [SecureString] - $PrivateKeyPassphrase, - [Parameter()] [WinSCP.Protocol] $Protocol = ( New-Object -TypeName WinSCP.Protocol ), + [Parameter()] + [SecureString] + $SecurePrivateKeyPassphrase, + [Parameter( ValueFromPipelineByPropertyName = $true )] diff --git a/WinSCP/Public/Remove-WinSCPItem.ps1 b/WinSCP/Public/Remove-WinSCPItem.ps1 index 8e38577..7e49d80 100644 --- a/WinSCP/Public/Remove-WinSCPItem.ps1 +++ b/WinSCP/Public/Remove-WinSCPItem.ps1 @@ -26,7 +26,8 @@ [Parameter( Mandatory = $true, - ValueFromPipelineByPropertyName = $true)] + ValueFromPipelineByPropertyName = $true + )] [String[]] $Path ) diff --git a/WinSCP/WinSCP.psd1 b/WinSCP/WinSCP.psd1 index 0e1e1b9..268b2cb 100644 --- a/WinSCP/WinSCP.psd1 +++ b/WinSCP/WinSCP.psd1 @@ -72,6 +72,7 @@ FormatsToProcess = @( # Functions to export from this module FunctionsToExport = @( "ConvertTo-WinSCPEscapedString", + "Copy-WinSCPItem", "Get-WinSCPChildItem", "Get-WinSCPItem", "Get-WinSCPItemChecksum", @@ -123,6 +124,7 @@ FileList = @( "en-US\WinSCP-Help.xml", "lib\WinSCPnet.dll", "Public\ConvertTo-WinSCPEscapedString.ps1", + "Public\Copy-WinSCPItem.ps1", "Public\Get-WinSCPChildItem.ps1", "Public\Get-WinSCPItem.ps1" "Public\Get-WinSCPItemChecksum.ps1", diff --git a/WinSCP/en-US/WinSCP-Help.xml b/WinSCP/en-US/WinSCP-Help.xml index aa68d3f..3e53f4a 100644 --- a/WinSCP/en-US/WinSCP-Help.xml +++ b/WinSCP/en-US/WinSCP-Help.xml @@ -116,6 +116,230 @@ PS C:\> Remove-WinSCPSession + + + Copy-WinSCPItem + Copy + WinSCPItem + + {{Fill in the Synopsis}} + + + + {{Fill in the Description}} + + + + Copy-WinSCPItem + + Path + + {{Fill Path Description}} + + String[] + + String[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + SwitchParameter + + + False + + + Destination + + {{Fill Destination Description}} + + String + + String + + + None + + + Force + + {{Fill Force Description}} + + + SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + + SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + SwitchParameter + + + False + + + WinSCPSession + + {{Fill WinSCPSession Description}} + + Session + + Session + + + None + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + Destination + + {{Fill Destination Description}} + + String + + String + + + None + + + Force + + {{Fill Force Description}} + + SwitchParameter + + SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + SwitchParameter + + SwitchParameter + + + False + + + Path + + {{Fill Path Description}} + + String[] + + String[] + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + SwitchParameter + + + False + + + WinSCPSession + + {{Fill WinSCPSession Description}} + + Session + + Session + + + None + + + + + + WinSCP.Session + + + System.String[] + + + + + + + System.Void + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + https://github.com/dotps1/WinSCP/wiki/Copy-WinSCPItem + https://github.com/dotps1/WinSCP/wiki/Copy-WinSCPItem + + + Get-WinSCPChildItem @@ -2529,18 +2753,6 @@ True 00:01:00 ftp.dotps1.github.io 0 - - PrivateKeyPassphrase - - Passphrase for encrypted private keys and client certificates. - - SecureString - - SecureString - - - None - Protocol @@ -2644,6 +2856,18 @@ True 00:01:00 ftp.dotps1.github.io False + + SecurePrivateKeyPassphrase + + {{Fill SecurePrivateKeyPassphrase Description}} + + SecureString + + SecureString + + + None + @@ -2731,18 +2955,6 @@ True 00:01:00 ftp.dotps1.github.io 0 - - PrivateKeyPassphrase - - Passphrase for encrypted private keys and client certificates. - - SecureString - - SecureString - - - None - Protocol @@ -2875,6 +3087,18 @@ True 00:01:00 ftp.dotps1.github.io False + + SecurePrivateKeyPassphrase + + {{Fill SecurePrivateKeyPassphrase Description}} + + SecureString + + SecureString + + + None + diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 647e2d4..8c15ec0 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -16,7 +16,7 @@ So please update the help in `.\Help\.md`, then compile a new `WinSC ```powershell New-ExternalHelp -Path .\Help -OutputPath .\WinSCP\en-US -Force ``` -And, if your feeling exceptionally helpful, the Wiki is its own repo, so you could also update that as well.: +And, if your feeling exceptionally helpful, the Wiki is its own repo, so you could also update that as well: ``` git clone https://github.io/dotps1/WinSCP/wiki.git ..\Wiki New-MarkdownHelp -Path .\Help -OutputPath ..\Wiki -NoMetadata -Force