Hi guys,
I was wondering if there is an faster way to create an pscredential object like this:
$UserName = "Foo" $pass = ConvertTo-SecureString "bar" -AsPlainText -Force $mycreds = New-Object -TypeName PSCredential -ArgumentList $UserName, $pass
Usually I try to use the type accelerator but but i don’t get it here ^^
$UserName = "Foo"
$pass = ConvertTo-SecureString "bar" -AsPlainText -Force
$mycreds = [pscredential] @{
UserName = $UserName
Password = $pass
}