Differences
This shows you the differences between the selected revisions of the page.
2016-11-21 | 2016-11-21 | ||
powershell reference link update (martin) | using ps> interwiki link (martin) | ||
Line 31: | Line 31: | ||
==== [[powershell]] PowerShell ==== | ==== [[powershell]] PowerShell ==== | ||
- | In [[library_powershell|PowerShell]] code using [[library|WinSCP .NET library]] you can use ''[[https://msdn.microsoft.com/powershell/reference/5.1/microsoft.powershell.management/Get-Content|Get-Content]]'' cmdlet to read an XML configuration file. | + | In [[library_powershell|PowerShell]] code using [[library|WinSCP .NET library]] you can use ''[[ps>microsoft.powershell.management/get-content|Get-Content]]'' cmdlet to read an XML configuration file. |
For example with following %%XML%% configuration file (''config.xml''): | For example with following %%XML%% configuration file (''config.xml''): | ||
Line 61: | Line 61: | ||
You can also leverage Windows Data Protection API to encrypt the password in the %%XML%% file. | You can also leverage Windows Data Protection API to encrypt the password in the %%XML%% file. | ||
- | To encrypt the password use ''[[https://technet.microsoft.com/en-us/library/hh849814.aspx|ConvertFrom-SecureString]]'' cmdlet: | + | To encrypt the password use ''[[ps>microsoft.powershell.security/convertfrom-securestring|ConvertFrom-SecureString]]'' cmdlet: |
<code powershell> | <code powershell> | ||
Line 78: | Line 78: | ||
</code> | </code> | ||
- | To decrypt the password, use ''[[https://technet.microsoft.com/en-us/library/hh849818.aspx|ConvertTo-SecureString]]'' cmdlet and assign the resulting ''[[https://msdn.microsoft.com/en-us/library/system.security.securestring.aspx|SecureString]]'' to ''SessionOptions.SecurePassword'': | + | To decrypt the password, use ''[[ps>microsoft.powershell.security/convertto-securestring|ConvertTo-SecureString]]'' cmdlet and assign the resulting ''[[https://msdn.microsoft.com/en-us/library/system.security.securestring.aspx|SecureString]]'' to ''SessionOptions.SecurePassword'': |
<code powershell> | <code powershell> |