2,187
edits
(Initial creation - content from depreciated PowerShell page) |
m (→Store Password Securely: Minor rewording etc) |
||
Line 44: | Line 44: | ||
</source> | </source> | ||
For a complete, but simple user/pass caching system use something like the following. | For a complete, but simple user/pass caching system use something like the following. I use this script to create a local user/pass file which gets used whenever I need to provide credentials in a script. | ||
<source lang="powershell"> | <source lang="powershell"> | ||
$UserFile = "User.fil" | |||
$PassFile = "Pass.fil" | |||
# Check for credential files, create if required | # Check for credential files, create if required | ||
if (!(Test-Path $UserFile) -or !(Test-Path $PassFile)) { | if (!(Test-Path $UserFile) -or !(Test-Path $PassFile)) { |