![]() |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
problem with Importing Credentials in PowerShell
trying to used a secure stored credential per post
here - "In the script that you want to run automatically, add the following commands: $password = Get-Content c:\temp\password.txt | ConvertTo-SecureString $credential = New-Object System.Management.Automation.PsCredential ` "CachedUser",$password " recieve error New-Object : A parameter cannot be found that matches parameter name 'System.Object[]'. At C:\SCRIPTS\test.ps1:2 char:25 + $credential = New-Object <<<< System.Management.Automation.PsCredential ` "CachedUser",$password i am inserting the given lines of code and passing parameter -credential $credntial in a get-wmi-object script |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Re: problem with Importing Credentials in PowerShell
> $credential = New-Object System.Management.Automation.PsCredential `
> > "CachedUser",$password Try putting this all on one single line: PS >$credential = New-Object System.Management.Automation.PsCredential "CachedUser",$password Marco -- Microsoft MVP - Windows PowerShell PowerGadgets MVP Blog: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
< Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |