Windows Shell Aliases
Shell Aliases Shell aliases allow you to navigate to special folders on Windows. They can be used in the Windows explorer, the start menu, and the Run dialog. For example, open the run dialog (Win+R) and type shell:personal and hit enter. Windows explorer will open in your Documents directory.
A complete list of these folders can be found in the following registry key:
1 HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions To enumerate their names and the relative path you can run the following PowerShell script:
Regex matches in PowerShell
How to find regex matches using PowerShell
Entering passwords securely in Powershell
What’s a SecureString? A number of commands in Powershell require you to pass sensitive credentials such as passwords as a SecureString. A SecureString represents some plain text (a string) coupled with additional security oriented features: * The raw data is obfuscated rather than stored as plain text. * It’s ‘pinned’ in memory, i.e. it won’t get moved around or copied when the operating system is trying to optimize resources. * When it’s disposed, the memory it occupies is freed immediately.
How to copy stdout to the clipboard in Powershell
Suppose you want to copy the output of a Powershell command to the clipboard. Instead of making a mess of selecting the output in the terminal and copying, just pipe the output to clip.
For example to copy your path environment variable to the clipboard run:
1 $Env:Path | clip The same can also be achieved using Set-Clipboard:
1 $Env:Path | Set-Clipboard To read the contents of the clipboard use Get-Clipboard: