PasswordState
PasswordState copied to clipboard
Some special characters in Passwords will result in an error
Expected Behavior
If you use special chars like ¤$ in your password, Invoke-Webrequest will give you an error, this is because powershell uses UniCode wheres as the web request expects UTF8
Current Behavior
Possible Solution
$result = Invoke-RestMethod -Uri $uri -Method Post -ContentType "application/$Format" -Headers $headers -Body ([System.Text.Encoding]::UTF8.GetBytes($json))
Force the json to be loaded as UTF8.
Steps to Reproduce (for bugs)
- New-PasswordStatePassword -ApiKey $ADUserListCred -PasswordListId 49 -Username ctn -Password ('1dsdsdsdfsdsd¤234' | ConvertTo-SecureString -AsPlainText -Force) -ExpiryDate '15-10-2020 14:37:30' -Title test1234 -Verbose 2. 3. 4.
Context
I am adding some extra stuff, so will do a PR when I get that worked out.
Your Environment
- Module version used:
- Operating System and PowerShell version:
Awesome. Thanks for finding this!