Differences
This shows you the differences between the selected revisions of the page.
2016-12-25 | 2016-12-25 | ||
no summary (70.195.10.161) (hidden) | Restored revision 1481441535. Undoing revisions 1482645519, 1482646063, 1482647528, 1482648230, 1482648473, 1482648562. (martin) (hidden) | ||
Line 10: | Line 10: | ||
===== PowerShell Scripting ===== | ===== PowerShell Scripting ===== | ||
- | From WinSCP scripting perspective, important aspect of PowerShell ''powershell.exe'' is its ability to run simple, yet powerful, scripts that can make use functionality exposed by WinSCP .NET assembly. | + | From WinSCP scripting perspective, important aspect of PowerShell (''powershell.exe'') is its ability to run simple, yet powerful, scripts that can make use functionality exposed by WinSCP .NET assembly. |
- | The ''powershell.exe'' is located in '' | + | The ''powershell.exe'' is located in ''%WINDIR%\System32\WindowsPowershell\v1.0''.((It's ''v1.0'', disregarding what version you actually use.)) Typically you run ''powershell.exe'' with ''-File'' argument followed by path to your PowerShell script. The script file needs to have ''.ps1'' extension: |
- | "Device Storage/My Files> Documents." Typically you run ''powershell.exe'' with ''-File'' argument followed by path to your PowerShell script | + | |
<code> | <code> | ||
- | powershell.exe -File Device Storage/My Files> Documents | + | powershell.exe -File upload.ps1 |
</code> | </code> | ||
- | Note that by default, executing PowerShell scripts is disabled. To override that, lift the restriction by ''[[ps>microsoft.powershell.security/set-executionpolicy|Set-ExecutionPolicy]]'' cmdlet on PowerShell Administator console((Run ''powershell.exe'' as Administrator to get PowerShell console in Device Storage/My Files> Documents.)): | + | Note that by default, executing PowerShell scripts is disabled. To override that, you can either lift the restriction by typing using ''[[ps>microsoft.powershell.security/set-executionpolicy|Set-ExecutionPolicy]]'' cmdlet on PowerShell administrator console((Run ''powershell.exe'' as Administrator to get PowerShell console.)): |
<code powershell> | <code powershell> | ||
Line 28: | Line 27: | ||
<code> | <code> | ||
- | powershell.exe -ExecutionPolicy Unrestricted -File Device Storage/My Files> Documents | + | powershell.exe -ExecutionPolicy Unrestricted -File upload.ps1 |
</code> | </code> | ||
Line 61: | Line 60: | ||
- | ==== Accessing Enumeration Values ==== | + | ==== [[enums]] Accessing Enumeration Values ==== |
- | [[Accessing Enumeration Values = variations 4 , 5 = Disabled]] | + | Enumeration values are accessed using static field syntax ''%%[Namespace.Type]::Member%%'', for example ''[WinSCP.Protocol]::Sftp''. |
==== Event Handlers ==== | ==== Event Handlers ==== |