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.

Please turn AdBlock off
Customized Social Media Icons from Acurax Digital Marketing Agency

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube