1
0
mirror of https://github.com/xcad2k/cheat-sheets.git synced 2022-05-05 20:20:37 +03:00

improve windows docs

This commit is contained in:
Christian Lempa
2022-04-07 14:09:59 +02:00
parent 88f2ba4606
commit c5aed81f44
4 changed files with 44 additions and 2 deletions

View File

View File

@@ -1,5 +1,5 @@
# Variables in Windows
## How to use in PowerShell
# Environment Variables in Windows
## How to use them in PowerShell
Environment Varaibles can be used in PowerShell ([[powershell]]) with the prefix `$env:`.
**Example***:

View File

@@ -0,0 +1,42 @@
# PowerShell Cheat-Sheet
PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language.
## Install PowerShell
PowerShell was made open-source and cross-platform with PowerShell Core, and can be installed on multiple operating systems.
### Windows
1. Download MSI Package from the [Official PowerShell Docs](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.2)
2. Set up PowerShell Profile in Windows Terminal ([[windowsterminal]]).
```json
"commandline": "pwsh.exe -nologo",
"name": "Powershell",
"source": "Windows.Terminal.PowershellCore"
```
### Linux (Ubuntu)
```sh
# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https software-properties-common
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Update the list of packages after we added packages.microsoft.com
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
pwsh
```
## Profile
Set up a PowerShell Profile by opening the profile script :
```powershell
code $PROFILE
```
## (Optional) Set up starship Prompt
You can customize the look and feel of PowerShell with the Starship Prompt ([[starship]]).