Added powershell notes to the knowledge base

This commit is contained in:
Michele Cereda
2022-04-20 21:07:56 +02:00
parent 97ed625ae0
commit 2c3d6e7aa4

View File

@@ -0,0 +1,22 @@
# Windows PowerShell
## TL;DR
```powershell
# print the value of the PATH environment variable
Write-Output $env:PATH
# calculate the hash of a file
CertUtil -hashfile path/to/file sha256
# get super user privileges
powershell Start-Process powershell -Verb runAs
```
## Further readings
- [How to print environment variables to the console in PowerShell?]
- [Running PowerShell as Administrator with the Command Line]
[how to print environment variables to the console in powershell?]: https://stackoverflow.com/questions/50861082/how-to-print-environment-variables-to-the-console-in-powershell#50861113
[running powershell as administrator with the command line]: https://adamtheautomator.com/powershell-run-as-administrator/