From 2c3d6e7aa4f777bc3fd07a1155e571ec0bc78b28 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Wed, 20 Apr 2022 21:07:56 +0200 Subject: [PATCH] Added powershell notes to the knowledge base --- knowledge base/powershell.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 knowledge base/powershell.md diff --git a/knowledge base/powershell.md b/knowledge base/powershell.md new file mode 100644 index 0000000..72031ab --- /dev/null +++ b/knowledge base/powershell.md @@ -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/