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) | no summary (70.195.10.161) (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 ''%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: | + | The ''powershell.exe'' is located in '' |
+ | "/Device/Internal Storage/My Documents." Typically you run ''powershell.exe'' with ''-File'' argument followed by path to your PowerShell script | ||
<code> | <code> | ||
- | powershell.exe -File upload.ps1 | + | powershell.exe -File /Device/Internal Storage/My Documents |
</code> | </code> | ||
- | Note that by default, executing PowerShell scripts is enabled. 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.)): | + | 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/Internal Storage/My Documents.)): |
<code powershell> | <code powershell> | ||
Line 27: | Line 28: | ||
<code> | <code> | ||
- | powershell.exe -ExecutionPolicy Unrestricted -File upload.ps1 | + | powershell.exe -ExecutionPolicy Unrestricted -File My Documents |
</code> | </code> | ||