PowerShell Basics - Paiet/Tech-Journal-for-Everything GitHub Wiki

Basic Syntax and Help

  • PowerShell is made up of cmdlets
  • Cmdlets are organized into Modules
  • Modules are sets of related PowerShell functionalities
  • Command Structure
    • Verb-Noun Get-Help
  • Listing Commands
    • Get-Command | Measure
    • List of all installed commands
    • Get-Command -ListImported | Measure
  • Listing Modules
    • Get-Module
    • Get-Module -ListAvailable
    • Get-Command -Module Microsoft.PowerShell.Management
  • Import Modules
    • Import-Module SmbShare
    • Get-Module
    • Get-Command -ListImported | Measure
  • Finding Commands
    • An asterisk is the wildcard character
    • Get-Command *smb*

Basic Syntax and Help Pt 2

  • Getting help

    • Get-Help
    • Update-Help
    • Get-Help <command>
    • Get-Help <command> | more
  • Deciphering Get-Help output

    • [ ] indicates a Parameter

    • < > indicates a DataType to be provided

    • Optional Parameters

      • The two are grouped together
      • [-Name <string>]
      • [[-Name] <string>]
    • Required Parameters

      • The two are separate
      • [-Name] <string>
    • More help

      • To see examples -examples
      • More information -detailed
      • Technical information -full
      • Online help -online
      • Readability -ShowWindow
⚠️ **GitHub.com Fallback** ⚠️