From dfdd034949c15d996482799269bf2aab0d68f80c Mon Sep 17 00:00:00 2001 From: mrsh Date: Sun, 4 Jan 2026 06:34:33 +0100 Subject: [PATCH] video stop at 28.44 --- 1-first_script.ps1 | 1 + Learn Powershell in Less than 2 hours.md | 67 ++++++++++++++++++++---- README.md | 3 ++ 3 files changed, 62 insertions(+), 9 deletions(-) diff --git a/1-first_script.ps1 b/1-first_script.ps1 index 0da4eaf..b9721d3 100644 --- a/1-first_script.ps1 +++ b/1-first_script.ps1 @@ -1,3 +1,4 @@ # This is a command +Write-Host "hello world" -NoNewline Write-Host "hello world" diff --git a/Learn Powershell in Less than 2 hours.md b/Learn Powershell in Less than 2 hours.md index cc2f4db..5e2103c 100644 --- a/Learn Powershell in Less than 2 hours.md +++ b/Learn Powershell in Less than 2 hours.md @@ -1,5 +1,22 @@ # Learn Powershell in Less Than 2 hours +**Everything in Powershell is an Object** + +## Widows Powershell ISE + +To be able to write Powershell script you have a free IDE + +## CMDLET + +Predifine functions are names CommandLet +Verb-Noun -Parameters + +If you want to see all the Cmdlet available + +``` +Get-Command -CommandTyper Cmdlet +``` + ## PSVersionTable you can see the version of powershell with the command @@ -14,22 +31,54 @@ To be able to see if you can run your Powershell scripts ```powershell Get-ExecutionPolicy -// Work only has administrator +# Work only has administrator Set-ExecutionPolicy remoteSigned ``` -### Widows Powershell ISE - -To be able to write Powershell script you have a free IDE - -## Commandes - - ### Write-Host For writing in the console ```powershell Write-Host "Hello world" - +Write-Host "Hello world" -NoNewline +Write-Host "Hello world" -BackgroundColor "Blue" +``` + +## GetHelp + +Print all the help articles from microsoft + +```powershell +Get-Help +Get-Help Write-Host -full +``` + + +## Piping + +You can chain commands with "|" + +```powershell +Command-1 | Command-2 +"May the force be with you!" | Out-File forewithwho.txt +``` + +## Variables + +They start with a "$" +you can use strings,floating points, integer and boolean + +```powershell +$FavCharacter = "Spongebob" +$FavCharacter | Out-File favcharacter.txt +$FavCharacter.GetType() + +$x = 5 +$y = 3 +$x + $y +# output: 8 + +$FavCharacter | Select-Object -Property * +# output all the Property of the variable ``` diff --git a/README.md b/README.md index e69de29..55b5858 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,3 @@ +Link to the youtube video + +