.NET assembly - Cannot transfer some *.pgp files
Hi Together,
I have create an script for transfering some pgp files to an sftp. The strange thing is, that it is working if I have an txt file, if I will transfer the pgp - no file will be uploaded.
This is the basic code I'm using
$session.Open($sessionOptions)
# *** Daten kopieren ***
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Ascii
$localfile = $file.Name
$transferResult = $session.PutFiles("C:\export\$localfile", "/in/", $False, $transferOptions)
I have tried it with transfermode: binary, ascii and automatic - no differences
I also make a:
Write-Error $tranferResult.check() -> Result:
"C:\NEWExport.ps1 : Exception of type 'Microsoft.PowerShell.Commands.WriteErrorException' was thrown.
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,NEWExport.ps1"
Can someone please help me
Thanks
Marius
I have create an script for transfering some pgp files to an sftp. The strange thing is, that it is working if I have an txt file, if I will transfer the pgp - no file will be uploaded.
This is the basic code I'm using
$session.Open($sessionOptions)
# *** Daten kopieren ***
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Ascii
$localfile = $file.Name
$transferResult = $session.PutFiles("C:\export\$localfile", "/in/", $False, $transferOptions)
I have tried it with transfermode: binary, ascii and automatic - no differences
I also make a:
Write-Error $tranferResult.check() -> Result:
"C:\NEWExport.ps1 : Exception of type 'Microsoft.PowerShell.Commands.WriteErrorException' was thrown.
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,NEWExport.ps1"
Can someone please help me
Thanks
Marius