This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create secure text file | |
| "secret_pass" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString > creds.secure | |
| # Set username | |
| $User="myDomain.com\svc_account" | |
| # Load secure string from file and convert to a SecureString object | |
| $pass = (Get-Content -Path "creds.secure" | ConvertTo-SecureString) | |
| # Create credential object |