Table of Contents
Command-line in PowerShell
Return to PowerShell, Windows PowerShell, PowerShell for Linux, Command-line interface, choco list --localonly, Chocolatey
SS64 How-to An A-Z Index of Windows PowerShell commands
% Alias for ForEach-Object ? Alias for Where-Object
A
F
-F operator Format operator. Unblock-File Unblock files downloaded from the Internet. * [[Get-FileHash Compute the hash value for a file. ForEach-Object foreach Loop through each item in the pipeline ( % ). ForEach Loop through each item in a collection. ForEach method Loop through each item in a collection. For Loop through items that match a condition. Format-Custom fc Format output using a customized view. Format-Hex fhx Display a file or other input as hexadecimal. Format-List fl Format output as a list of properties, each on a new line. Format-Table ft Format output as a table. Format-Wide fw Format output as a table listing one property only. Export-FormatData Save formatting data from the current session. * [[Get-FormatData * [[Get the formatting data in the current session.G
- active, read-only, offline. * [[Convert-Path cvpa Convert a ps path to a provider path. Join-Path Combine a path and one or more child-paths. Resolve-Path rvpa Resolves the wildcards in a path. Split-Path Return part of a path. Test-Path Return true if the path exists, otherwise return false. Pause Pause and display the message "Press Enter to continue..." * [[Invoke-Pester Invoke Pester to recursively run all tests. Export-PfxCertificate Export a certificate or a PFXData object to a PFX file. * [[Get-PfxCertificate * [[Get pfx certificate information. * [[Get-PhysicalDisk Retrieve a list of Physical Disk objects. Remove-PhysicalDisk Remove a physical disk from a specified storage pool. * [[Set-PhysicalDisk Set attributes on a specific physical disk. * [[Get-PnpDevice Return information about PnP devices. Pop-Location popd Set the current working location from the stack. Push-Location pushd Push a location to the stack. Powershell Launch a PowerShell session/run a script. Add-Printer Add a printer to the specified computer. * [[Get-Printer Retrieve a list of printers installed on a computer. Remove-Printer Remove a printer from the specified computer. * [[Set-Printer Update the configuration of an existing printer. Add-PrinterDriver Install a printer driver on the computer. Add-PrinterPort Install a printer port on the computer. * [[Get-PrintJob Retrieve a list of print jobs from the specified printer. Process Function PROCESS block. * [[Get-Process ps/gps Get a list of processes on a machine. Debug-Process Attach a debugger to a running process. Start-Process start/saps Start one or more processes. Stop-Process kill/spps Stop a running process. Wait-Process Wait for a process to stop. Enable-PSBreakpoint ebp Enable a breakpoint in the current console. Disable-PSBreakpoint dbp Disable a breakpoint in the current console. * [[Get-PSBreakpoint gbp Get the currently set breakpoints. * [[Set-PSBreakpoint sbp Set a breakpoint on a line, command, or variable. Remove-PSBreakpoint rbp Delete breakpoints from the current console. * [[Get-PSCallStack gcs Display the current call stack. * [[Get-PSDrive gdr Get drive information (DriveInfo). New-PSDrive mount/ndr Create a mapped network drive. Remove-PSDrive rdr Remove a provider/drive from its location. * [[Get-PSProvider * [[Get information for the specified provider. * [[Set-PSdebug Turn script debugging on or off. Disable-PSRemoting Disable remote session configuration on the local computer. Enable-PSRemoting Configure the computer to receive remote commands. * [[Get-PSRepository * [[Get PowerShell repositories. Register-PSRepository Register a PowerShell repository. * [[Set-PSRepository Set values for a registered repository. Connect-PSSession cnsn Reconnect to a disconnected session. Disconnect-PSSession dnsn Disconnect from a session. Enter-PSSession etsn Start an interactive session with a remote computer. Exit-PSSession exsn End an interactive session with a remote computer. Export-PSSession epsn Import commands and save them in a PowerShell module. * [[Get-PSSession gsn * [[Get the PSSessions in the current session. * [[Import-PSSession ipsn Import commands from another session. New-PSSession nsn Create a persistent connection to a local or remote computer. Remove-PSSession rsn Close PowerShell sessions. Disable-PSSessionConfiguration - Disable session configurations on the local computer.
Enable-PSSessionConfiguration]] - Enable session configurations on the local computer. * [[Get-PSSessionConfiguration]] - Get the registered PS session configuration. Register-PSSessionConfiguration]] - Create and register a new PS session configuration. * [[Set-PSSessionConfiguration]] - Change properties of a registered session configuration. Unregister-PSSessionConfiguration]] - Delete registered PS session configuration. New-PSSessionConfigurationFile Create a file that defines a session configuration. New-PSSessionOption Advanced options for a PSSession. Add-PsSnapIn asnp Add snap-ins to the console.
- Get-PsSnapin gsnp List PowerShell snap-ins on this computer. Remove-PSSnapin rsnp Remove PowerShell snap-ins from the console. R * [[Get-Random * [[Get a random number. Read-Host Read a line of input from the host console. Remove-Item rm/del/erase/rd/ri/rmdir Remove an item. * [[Rename-Item ren/rni Change the name of an existing item. * [[Rename-ItemProperty Rename a property of an item. Restart-Computer Restart the operating system on a computer. Return Exit the current scope, (function, script, or script block). Run/Call & Run a command (call operator). S Scheduler cmdlets * [[Get/Set scheduled jobs. Confirm-SecureBootUEFI Confirm that Secure Boot is enabled on the local computer. Select-Object select Select properties of objects. Select-XML Find text in an XML string or document. New-SelfSignedCertificate Create a new self-signed certificate for testing purposes. Send-MailMessage Send an email message. * [[Get-Service gsv Get a list of services. New-Service Create a new service. Restart-Service Stop and then restart a service. Resume-Service Resume a suspended service. * [[Set-Service Change the start mode/properties of a service. Start-Service sasv Start a stopped service. Stop-Service spsv Stop a running service. Suspend-Service Suspend a running service. Sort-Object sort Sort objects by property value. * [[Get-SmbConnection Retrieve the connections established from the SMB client to the SMB servers. * [[Get-SmbOpenFile Information about files that are open on behalf of SMB server clients. * [[Get-SMBMapping * [[Get an SMB mapping. New-SmbMapping Create an SMB mapping. Remove-SmbMapping Remove an SMB mapping. * [[Get-SmbSession Retrieve information about current SMB sessions. Set-SmbClientConfiguration Set the SMB client configuration. Get-SmbServerConfiguration Get the SMB Server configuration. Set-SmbServerConfiguration Set the SMB Server configuration. * [[Get-SmbShare Retrieve the SMB shares on the computer. * [[Set-SmbShare Modify the properties of an SMB share. New-SmbShare Create an SMB share. * [[Get-SmbShareAccess Retrieve the ACL of an SMB share. Grant-SmbShareAccess Add an allow ACE for a trustee to the security descriptor of the SMB share. * [[Set-StrictMode Enforce coding rules in expressions & scripts. * [[Get-StartApps * [[Get the names and IDs of apps installed on the Start Menu. Export-StartLayout Export layout of the Start screen as an .xml file. * [[Import-StartLayout Import the layout of the Start into a mounted Windows image. Start-Sleep sleep Suspend shell, script, or runspace activity. * [[Get-StorageJob Information about long-running Storage module jobs, such as a repair task. New-StoragePool Create a new storage pool using a group of physical disks. Switch Check multiple conditions. * [[ConvertFrom-StringData Convert a here-string into a hash table. Select-String Search through strings or files for patterns. T Tee-Object tee Send input objects to two places. New-Timespan Create a timespan object. * [[Get-TimeZone gtz Get the current time zone or a list of available time zones. * [[Set-TimeZone stz Set the system time zone to a specified time zone. * [[Get-TlsCipherSuite * [[Get the list of cipher suites for TLS for a computer. * [[Get-Tpm Trusted Platform Module (TPM) Trace-Command Trace an expression or command. * [[Get-Tracesource * [[Get components that are instrumented for tracing. * [[Set-Tracesource Trace a PowerShell component. Start-Transaction Start a new transaction. Complete-Transaction Commit the transaction. * [[Get-Transaction * [[Get information about the active transaction. Use-Transaction Add a command or expression to the transaction. Undo-Transaction Roll back a transaction. Start-Transcript Start a transcript of a command shell session. Stop-Transcript Stop the transcription process. Trap Handle a terminating error. Try ... Catch Handle a terminating error within a scriptblock. Add-Type Add a .NET Framework type to a PowerShell session. Update-TypeData Update extended type configuration. ==U== * [[Get-Uiculture * [[Get the ui culture information. Unblock-File Unblock files downloaded from the Internet. * [[Get-Unique gu Get the unique items in a collection. Update-Formatdata Update and append format data files. Update-Help Download and install help files. Update-Typedata Update the current extended type configuration. ==V== * [[Clear-Variable - clv - Remove the value from a PowerShell variable.
- New-Variable - nv - Create a new variable.
Remove-Variable rv Remove a variable and its value. * [[Set-Variable set/sv Set a variable and a value. * [[Get-VirtualDisk Return a list of VirtualDisks across storage pools/providers. New-VirtualDisk Create a new virtual disk in the specified storage pool. * [[Get-Volume * [[Get the specified Volume object, or all Volume objects. Format-Volume Format one or more volumes. New-Volume Create a volume with the specified file system. Optimize-Volume Optimize a volume. Repair-Volume Perform repairs on a volume. Add-VpnConnection Add a VPN connection to the Connection Manager phone book. * [[Get-VpnConnection Retrieve the specified VPN connection profile information. * [[Set-VpnConnection Change the config. of a VPN connection profile. Add-VpnConnectionRoute Add a route to a VPN connection.
W
- Get-WebApplicationMonitoringStatus - Get the monitoring status of web apps.
Invoke-WebRequest * Get content from a web page. Where-Object where/ - Compress or Extract zip files.
- . (source) - Run a command script in the current shell.
- & (call) - Run a command, script or function.
- % - Alias for ForEach-Object.
- – - %Stop parsing input.
- ? - Alias for Where-Object.
- $variable = “value” - Define a variable also: ${n!a#me} = “value”.
- $_ - The current pipeline object.
- @(…) - Force an expression to be evaluated as an array.
- Escape or Continue on the next line.
The cmdlets above are listed in A-Z order, matching the Verb- and/or -Noun and/or Alias of the cmdlet (so some duplicates).
PowerShell can also run all the standard CMD commands (external commands), .cmd batch files will run within a CMD.exe shell (so can include internal CMD commands), plus all Resource Kit utilities. VBScripts can be run via cscript. [ Examples ]
Microsoft: PowerShell 5.1 cmdlets, 2.0/3.0 core cmdlets, Windows 2008 R2 cmdlets… more optional cmdlets.
Discussion forum - New!
See also: Websites, additional cmdlets, Utilities and Books for PowerShell.
Copyright © 1999-2021 SS64.com
Some rights reserved