Differences

This shows you the differences between the selected revisions of the page.

2015-08-24 2015-08-27
undoing, we actually wanted the powershell code to be as close to c# other examples as possible (martin) (hidden) in ps 1.0 add-type does not work at all (martin)
Line 45: Line 45:
</code> </code>
-Had you need to run the script from other directory, you need to specify a full path to the assembly. You can derive the path from the script file path using ''[[http://technet.microsoft.com/en-us/library/hh847768.aspx|$PSScriptRoot]]'' automatic variable:((In PowerShell 1.0 and 2.0, use ''%%Add-Type -Path (Join-Path (Split-Path $script:MyInvocation.MyCommand.Path) "WinSCPnet.dll")%%''))+Had you need to run the script from other directory, you need to specify a full path to the assembly. You can derive the path from the script file path using ''[[http://technet.microsoft.com/en-us/library/hh847768.aspx|$PSScriptRoot]]'' automatic variable:((In PowerShell 2.0, use ''%%Add-Type -Path (Join-Path (Split-Path $script:MyInvocation.MyCommand.Path) "WinSCPnet.dll")%%''))
<code powershell> <code powershell>

Last modified: by martin