POwershell Flashcards
(10 cards)
What is PowerShell?
PowerShell is a Microsoft framework for task automation and configuration management.
What is the difference between PowerShell and Command Prompt?
PowerShell uses cmdlets, while Command Prompt uses commands.
What are cmdlets?
Cmdlets are small, specialized commands in PowerShell.
How do you comment in PowerShell?
Comment in PowerShell with # for single-line and <# … #> for block comments.
What is the pipeline in PowerShell?
Pipeline (|) passes output of one cmdlet to another for chaining commands.
How do you handle errors in PowerShell?
Handle errors with try, catch, and finally blocks.
What is the difference between Write-Host and Write-Output?
Write-Host for console output, Write-Output for pipeline output.
How do you create a function in PowerShell?
Create a function with the function keyword followed by its name and body.
What is the $PSVersionTable variable used for?
$PSVersionTable holds PowerShell environment info, including version.
How do you import a module in PowerShell?
Import modules with Import-Module cmdlet or in profile script.