Windows Classroom Series – 24/Sept/2020

Updating the Docs

  • Update the Docs using the cmdlet
Update-Help

DataTypes

  • Boolean: $true or $false
  • Numeric data types:
  • Strings

Objects:

  • Everything in Powershell is object.
  • Object will have Methods, Properties
$purpose = 'Learning'
Select-Object -InputObject $purpose -Property *
$purpose.Length
  • Get-Members
$purpose = 'Learning'
Get-Member -InputObject $purpose
Get-Member -InputObject $purpose -Name Remove
$purpose.Remove(0,1)

Arrays

  • Launch Powershell and execute
$superHeros = @('IronMan', 'Thor', 'Hulk', 'CaptianAmerica')

Topics to be spoken later

  • ArrayList
  • HashTable
  • CustomObject

Pipeline for Commands in Powershell

  • Pipeline is passing the output of one command to other
<cmd-a>|<cmd-b>
Output of command a will be input to cmd b
  • In Linux shell the output of command is sent as text to cmd-b, In Powershell the whole object is sent.
Get-Service 'PrintNotify' | Start-Service
Get-Service 'PrintNotify' | Stop-Service
  • Lets Create a text file

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin