Sometimes you just need to create a PSCredential object in your PowerShell script. In VS Code I was not able to find any snippet that did this so created one.
You can add this to the powershell.json
snippet file for your VS Code instance. Use Command Palette > Configure User Snippets > PowerShell to open that file.
Then paste the code in the json file of this Gist.
You can use either cred
or pscred
to bring up the snippet in any editor set to the PowerShell language: