SlideShare a Scribd company logo
Automation and Configuration Management Hitesh Mohapatra
Lab 1: Configuring Windows PowerShell and working with basic
commands
Configuring the Windows PowerShell console
Configuring the Windows PowerShell ISE application
Finding commands
Running commands
Using the About files
1. Get-Command
Get-Command is an easy-to-use reference cmdlet that brings up all the
commands available for use in your current session.
Simply type in this command: get-command
2. Get-Help
The Get-Help command is essential for anyone using PowerShell,
providing quick access to the information you need to run and work with
all of the available commands.
Simply type in this command: Get-Help
3. Get-Service
It’s also helpful to know what services are installed on the system. You can
easily access this information with the following command:
Simply type in this command: Get-Service
If you need to know if a specific service is installed, you can append the
-Name switch and the name of the service, and Windows will show the
state of the service. Additionally, you can leverage filtering capabilities to
return a specific subset of currently installed services. The following
example will result in an output of data from the Get-Service command
Automation and Configuration Management Hitesh Mohapatra
that’s been piped to the Where-Object cmdlet, which then filters out
everything other than the services that have been stopped:
4. Get-EventLog
You can actually use PowerShell to parse your machine’s event logs using
the Get-EventLog cmdlet. There are several parameters available. Use
the -Log switch followed by the name of the log file to view a specific log.
You’d use the following command, for example, to view the Application
log:
Simply type in this command: Get-EventLog -Log "Application"
Check out a few more examples of Get-EventLog in action in this post
-Verbose
-Debug
-ErrorAction
-ErrorVariable
-WarningAction
-WarningVariable
-OutBuffer
-OutVariable
5. Get-Process
Much like getting a list of available services, it’s often useful to be able to
get a quick list of all the currently running processes. The Get-Process
command puts this information at your fingertips.
Bonus: Use Stop-Process to stop processes that are frozen or is no longer
responding. If you’re not sure what process is holding you up, use Get-
Process to quickly identify the problematic process. Once you have the
name or process ID, use Stop-Process to terminate it.
Here’s an example. Run this command to terminate all currently running
instances of Notepad:
Automation and Configuration Management Hitesh Mohapatra
Stop-Process -processname notepad
You can use wildcard characters, too, such as the following example which
terminates all instances of Notepad as well as any other processes
beginning with note:
Stop-Process -processname note*
6. Clear-History
What if you want to clear the entries from your command history? Easy –
use the Clear-History cmdlet. You can also use it to delete only specific
commands. For example, the following command would delete
commands that include “help” or end in “command”
PS C:> Clear-History -Command *help*, *command
If you want to add entries to a session, use: Add-History
7. Set-ExecutionPolicy
Although you can create and execute PowerShell scripts, Microsoft has
disabled scripting by default in an effort to prevent malicious code from
executing in a PowerShell environment. You can use the Set-
ExecutionPolicy command to control the level of security surrounding
PowerShell scripts. Four levels of security are available to you:
Restricted -- Restricted is the default execution policy and locks
PowerShell down so that commands can be entered only interactively.
PowerShell scripts are not allowed to run.
All Signed -- If the execution policy is set to All Signed then scripts will
be allowed to run, but only if they are signed by a trusted publisher.
Remote Signed -- If the execution policy is set to Remote Signed, any
PowerShell scripts that have been locally created will be allowed to run.
Scripts created remotely are allowed to run only if they are signed by a
trusted publisher.
Unrestricted -- As the name implies, Unrestricted removes all restrictions
from the execution policy.
Automation and Configuration Management Hitesh Mohapatra
You can set an execution policy by entering the Set-ExecutionPolicy
command followed by the name of the policy. For example, if you wanted
to allow scripts to run in an unrestricted manner you could type:
Set-ExecutionPolicy Unrestricted
8. Get-EventLog
You can actually use PowerShell to parse your computer's event logs.
There are several parameters available, but you can try out the command
by simply providing the -Log switch followed by the name of the log file.
For example, to see the Application log, you could use the following
command:
Get-EventLog -Log "Application"
Of course, you would rarely use this command in the real world. You're
more likely to use other commands to filter the output and dump it to a
CSV or an HTML file.
9. Select-Object
If you tried using the command above, you know that there were
numerous properties included in the CSV file. It's often helpful to narrow
things down by including only the properties you are really interested in.
This is where the Select-Object command comes into play. The Select-
Object command allows you to specify specific properties for inclusion.
For example, to create a CSV file containing the name of each system
service and its status, you could use the following command:
Get-Service | Select-Object Name, Status | Export-CSV c:service.csv
Command
alias
Cmdlet name Description of command
Automation and Configuration Management Hitesh Mohapatra
% ForEach-Object Performs an operation against
each item in a collection of
input objects.
? Where-Object Selects objects from a
collection based on their
property values.
ac Add-Content Appends content, such as words
or data, to a file.
asnp Add-PSSnapIn Adds one or more Windows
PowerShell snap-ins to the
current session.
cat Get-Content Gets the contents of a file.
cd Set-Location Sets the current working
location to a specified
location.
chdir Set-Location Sets the current working
location to a specified
location.
clc Clear-Content Deletes the contents of an item,
but does not delete the item.
clear Clear-Host Clears the display in the host
program.
clhy Clear-History Deletes entries from the command
history.
cli Clear-Item Deletes the contents of an item,
but does not delete the item.
clp Clear-ItemProperty Deletes the value of a property
but does not delete the
property.
cls Clear-Host Clears the display in the host
program.
clv Clear-Variable Deletes the value of a variable.
Automation and Configuration Management Hitesh Mohapatra
cnsn Connect-PSSession Reconnects to disconnected
sessions
compare Compare-Object Compares two sets of objects.
copy Copy-Item Copies an item from one location
to another.
cp Copy-Item Copies an item from one location
to another.
cpi Copy-Item Copies an item from one location
to another.
cpp Copy-ItemProperty Copies a property and value from
a specified location to another
location.
curl Invoke-WebRequest Gets content from a webpage on
the Internet.
cvpa Convert-Path Converts a path from a Windows
PowerShell path to a Windows
PowerShell provider path.
dbp Disable-PSBreakpoint Disables the breakpoints in the
current console.
del Remove-Item Deletes files and folders.
diff Compare-Object Compares two sets of objects.
dir Get-ChildItem Gets the files and folders in a
file system drive.
dnsn Disconnect-PSSession Disconnects from a session.
ebp Enable-PSBreakpoint Enables the breakpoints in the
current console.
echo Write-Output Sends the specified objects to
the next command in the
pipeline. If the command is the
last command in the pipeline,
the objects are displayed in the
console.
Automation and Configuration Management Hitesh Mohapatra
epal Export-Alias Exports information about
currently defined aliases to a
file.
epcsv Export-Csv Converts objects into a series
of comma-separated (CSV) strings
and saves the strings in a CSV
file.
epsn Export-PSSession Imports commands from another
session and saves them in a
Windows PowerShell module.
erase Remove-Item Deletes files and folders.
etsn Enter-PSSession Starts an interactive session
with a remote computer.
exsn Exit-PSSession Ends an interactive session with
a remote computer.
fc Format-Custom Uses a customized view to format
the output.
fl Format-List Formats the output as a list of
properties in which each
property appears on a new line.
foreach ForEach-Object Performs an operation against
each item in a collection of
input objects.
ft Format-Table Formats the output as a table.
fw Format-Wide Formats objects as a wide table
that displays only one property
of each object.
gal Get-Alias Gets the aliases for the current
session.
gbp Get-PSBreakpoint Gets the breakpoints that are
set in the current session.
gc Get-Content Gets the contents of a file.
Automation and Configuration Management Hitesh Mohapatra
gci Get-ChildItem Gets the files and folders in a
file system drive.
gcm Get-Command Gets all commands.
gcs Get-PSCallStack Displays the current call stack.
gdr Get-PSDrive Gets drives in the current
session.
ghy Get-History Gets a list of the commands
entered during the current
session.
gi Get-Item Gets files and folders.
gjb Get-Job Gets Windows PowerShell
background jobs that are running
in the current session.
gl Get-Location Gets information about the
current working location or a
location stack.
gm Get-Member Gets the properties and methods
of objects.
gmo Get-Module Gets the modules that have been
imported or that can be imported
into the current session.
gp Get-ItemProperty Gets the properties of a
specified item.
gps Get-Process Gets the processes that are
running on the local computer or
a remote computer.
group Group-Object Groups objects that contain the
same value for specified
properties.
gsn Get-PSSession Gets the Windows PowerShell
sessions on local and remote
computers.
Automation and Configuration Management Hitesh Mohapatra
gsnp Get-PSSnapIn Gets the Windows PowerShell
snap-ins on the computer.
gsv Get-Service Gets the services on a local or
remote computer.
gu Get-Unique Returns unique items from a
sorted list.
gv Get-Variable Gets the variables in the
current console.
gwmi Get-WmiObject Gets instances of Windows
Management Instrumentation (WMI)
classes or information about the
available classes.
h Get-History Gets a list of the commands
entered during the current
session.
history Get-History Gets a list of the commands
entered during the current
session.
icm Invoke-Command Runs commands on local and
remote computers.
iex Invoke-Expression Runs commands or expressions on
the local computer.
ihy Invoke-History Runs commands from the session
history.
ii Invoke-Item Performs the default action on
the specified item.
ipal Import-Alias Imports an alias list from a
file.
ipcsv Import-Csv Creates table-like custom
objects from the items in a CSV
file.
ipmo Import-Module Adds modules to the current
session.
Automation and Configuration Management Hitesh Mohapatra
ipsn Import-PSSes
sion
Imports commands from another
session into the current
session.
irm Invoke-RestMethod Sends an HTTP or HTTPS request
to a RESTful web service.
ise powershell_ise.exe Explains how to use the
PowerShell_ISE.exe command-line
tool.
iwmi Invoke-WMIMethod Calls Windows Management
Instrumentation (WMI) methods.
iwr Invoke-WebRequest Gets content from a web page on
the Internet.
kill Stop-Process Stops one or more running
processes.
lp Out-Printer Sends output to a printer.
ls Get-ChildItem Gets the files and folders in a
file system drive.
man help Displays information about
Windows PowerShell commands and
concepts.
md mkdir Creates a new item.
measure Measure-Object Calculates the numeric
properties of objects, and the
characters, words, and lines in
string objects, such as files of
text.
mi Move-Item Moves an item from one location
to another.
mount New-PSDrive Creates temporary and persistent
mapped network drives.
move Move-Item Moves an item from one location
to another.
Automation and Configuration Management Hitesh Mohapatra
mp Move-ItemProperty Moves a property from one
location to another.
mv Move-Item Moves an item from one location
to another.
nal New-Alias Creates a new alias.
ndr New-PSDrive Creates temporary and persistent
mapped network drives.
ni New-Item Creates a new item.
nmo New-Module Creates a new dynamic module
that exists only in memory.
npssc New-
PSSessionConfigurationFile
Creates a file that defines a
session configuration.
nsn New-PSSession Creates a persistent connection
to a local or remote computer.
nv New-Variable Creates a new variable.
ogv Out-GridView Sends output to an interactive
table in a separate window.
oh Out-Host Sends output to the command
line.
popd Pop-Location Changes the current location to
the location most recently
pushed to the stack. You can pop
the location from the default
stack or from a stack that you
create by using the Push-
Location cmdlet.
ps Get-Process Gets the processes that are
running on the local computer or
a remote computer.
pushd Push-Location Adds the current location to the
top of a location stack.
Automation and Configuration Management Hitesh Mohapatra
pwd Get-Location Gets information about the
current working location or a
location stack.
r Invoke-History Runs commands from the session
history.
rbp Remove-PSBreakpoint Deletes breakpoints from the
current console.
rcjb Receive-Job Gets the results of the Windows
PowerShell background jobs in
the current session.
rcsn Receive-PSSession Gets results of commands in
disconnected sessions.
rd Remove-Item Deletes files and folders.
rdr Remove-PSDrive Deletes temporary Windows
PowerShell drives and
disconnects mapped network
drives.
ren Rename-Item Renames an item in a Windows
PowerShell provider namespace.
ri Remove-Item Deletes files and folders.
rjb
Remove-Job Deletes a Windows PowerShell
background job.
rm Remove-Item Deletes files and folders.
rmdir Remove-Item Deletes files and folders.
rmo Remove-Module Removes modules from the current
session.
rni Rename-Item Renames an item in a Windows
PowerShell provider namespace.
rnp Rename-ItemProperty Renames a property of an item.
rp Remove-ItemProperty Deletes the property and its
value from an item.
Automation and Configuration Management Hitesh Mohapatra
rsn Remove-PSSession Closes one or more Windows
PowerShell sessions
(PSSessions).
rsnp Remove-PSSnapin Removes Windows PowerShell snap-
ins from the current session.
rujb Resume-Job Restarts a suspended job
rv Remove-Variable Deletes a variable and its
value.
rvpa Resolve-Path Resolves the wildcard characters
in a path, and displays the path
contents.
rwmi Remove-WMIObject Deletes an instance of an
existing Windows Management
Instrumentation (WMI) class.
sajb Start-Job Starts a Windows PowerShell
background job.
sal Set-Alias Creates or changes an alias
(alternate name) for a cmdlet or
other command element in the
current Windows PowerShell
session.
saps Start-Process Starts one or more processes on
the local computer.
sasv Start-Service Starts one or more stopped
services.
sbp Set-PSBreakpoint Sets a breakpoint on a line,
command, or variable.
sc Set-Content Replaces the contents of a file
with contents that you specify.
select Select-Object Selects objects or object
properties.
set Set-Variable Sets the value of a variable.
Creates the variable if one with
the requested name does not
exist.
Automation and Configuration Management Hitesh Mohapatra
shcm Show-Command Creates Windows PowerShell
commands in a graphical command
window.
si Set-Item Changes the value of an item to
the valu
References:
1. https://serverfault.com/questions/683942/use-powershell-to-create-a-web-page-from-an-array
2. https://devblogs.microsoft.com/scripting/use-the-powershell-group-object-cmdlet-to-display-
data/
3. https://docs.microsoft.com/en-us/powershell/module/nettcpip/set-netipaddress?view=win10-
ps
4. https://devblogs.microsoft.com/scripting/order-your-output-by-easily-sorting-objects-in-
powershell/

More Related Content

What's hot

Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
Boulos Dib
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Edureka!
 
Hypervisor
HypervisorHypervisor
Hypervisor
kalpita surve
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
Gaurav Shinde
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
Hanan Nmr
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
Lilesh Pathe
 
Windows server
Windows serverWindows server
Windows server
Hideo Amezawa
 
Python/Flask Presentation
Python/Flask PresentationPython/Flask Presentation
Python/Flask Presentation
Parag Mujumdar
 
MSIX: Inside and Out
MSIX: Inside and OutMSIX: Inside and Out
MSIX: Inside and Out
Windows Developer
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
Papu Kumar
 
PowerShell-1
PowerShell-1PowerShell-1
PowerShell-1
Saravanan G
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
abclearnn
 
MYSQL - PHP Database Connectivity
MYSQL - PHP Database ConnectivityMYSQL - PHP Database Connectivity
MYSQL - PHP Database Connectivity
V.V.Vanniaperumal College for Women
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
vceder
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Manav Prasad
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
Sandun Perera
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
Raghu nath
 
Taking User Input in Java
Taking User Input in JavaTaking User Input in Java
Taking User Input in Java
Eftakhairul Islam
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Ashrith Mekala
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
MAGNA COLLEGE OF ENGINEERING
 

What's hot (20)

Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
 
Hypervisor
HypervisorHypervisor
Hypervisor
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 
Windows server
Windows serverWindows server
Windows server
 
Python/Flask Presentation
Python/Flask PresentationPython/Flask Presentation
Python/Flask Presentation
 
MSIX: Inside and Out
MSIX: Inside and OutMSIX: Inside and Out
MSIX: Inside and Out
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
 
PowerShell-1
PowerShell-1PowerShell-1
PowerShell-1
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
MYSQL - PHP Database Connectivity
MYSQL - PHP Database ConnectivityMYSQL - PHP Database Connectivity
MYSQL - PHP Database Connectivity
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
 
Taking User Input in Java
Taking User Input in JavaTaking User Input in Java
Taking User Input in Java
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 

Similar to Basic commands for powershell : Configuring Windows PowerShell and working with basic commands

Windows power shell basics
Windows power shell basicsWindows power shell basics
Windows power shell basics
Dan Morrill
 
Power Shell for System Admins - By Kaustubh
Power Shell for System Admins - By KaustubhPower Shell for System Admins - By Kaustubh
Power Shell for System Admins - By Kaustubh
Kaustubh Kumar
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
ClapperboardCinemaPV
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge Club
Essam Salah
 
NIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShellNIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShell
Phan Hien
 
A Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conferenceA Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conference
ohadlevy
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltStack
 
Powershell Training
Powershell TrainingPowershell Training
Powershell Training
Fahad Noaman
 
R12 d49656 gc10-apps dba 26
R12 d49656 gc10-apps dba 26R12 d49656 gc10-apps dba 26
R12 d49656 gc10-apps dba 26
zeesniper
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Pwning with powershell
Pwning with powershellPwning with powershell
Pwning with powershell
jaredhaight
 
PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)
Concentrated Technology
 
Intro to PowerShell
Intro to PowerShellIntro to PowerShell
Intro to PowerShell
Adam Preston
 
One click deployment
One click deploymentOne click deployment
One click deployment
Alex Su
 
PowerShell-2
PowerShell-2PowerShell-2
PowerShell-2
Saravanan G
 
BestInFlowCompetitionTutorials03May2023
BestInFlowCompetitionTutorials03May2023BestInFlowCompetitionTutorials03May2023
BestInFlowCompetitionTutorials03May2023
Timothy Spann
 
Puppet quick start guide
Puppet quick start guidePuppet quick start guide
Puppet quick start guide
Suhan Dharmasuriya
 
NZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePointNZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePoint
Nick Hadlee
 
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEWINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
Hitesh Mohapatra
 

Similar to Basic commands for powershell : Configuring Windows PowerShell and working with basic commands (20)

Windows power shell basics
Windows power shell basicsWindows power shell basics
Windows power shell basics
 
Power Shell for System Admins - By Kaustubh
Power Shell for System Admins - By KaustubhPower Shell for System Admins - By Kaustubh
Power Shell for System Admins - By Kaustubh
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge Club
 
NIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShellNIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShell
 
A Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conferenceA Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conference
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 
Powershell Training
Powershell TrainingPowershell Training
Powershell Training
 
R12 d49656 gc10-apps dba 26
R12 d49656 gc10-apps dba 26R12 d49656 gc10-apps dba 26
R12 d49656 gc10-apps dba 26
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
Pwning with powershell
Pwning with powershellPwning with powershell
Pwning with powershell
 
PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)
 
Intro to PowerShell
Intro to PowerShellIntro to PowerShell
Intro to PowerShell
 
One click deployment
One click deploymentOne click deployment
One click deployment
 
PowerShell-2
PowerShell-2PowerShell-2
PowerShell-2
 
BestInFlowCompetitionTutorials03May2023
BestInFlowCompetitionTutorials03May2023BestInFlowCompetitionTutorials03May2023
BestInFlowCompetitionTutorials03May2023
 
Puppet quick start guide
Puppet quick start guidePuppet quick start guide
Puppet quick start guide
 
NZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePointNZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePoint
 
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEWINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
 

More from Hitesh Mohapatra

Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Virtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud ComputingVirtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud Computing
Hitesh Mohapatra
 
Automating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine ProvisioningAutomating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine Provisioning
Hitesh Mohapatra
 
Harnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and ApplicationsHarnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and Applications
Hitesh Mohapatra
 
Scheduling in Cloud Computing
Scheduling in Cloud ComputingScheduling in Cloud Computing
Scheduling in Cloud Computing
Hitesh Mohapatra
 
Cloud-Case study
Cloud-Case study Cloud-Case study
Cloud-Case study
Hitesh Mohapatra
 
RAID
RAIDRAID
Load balancing in cloud computing.pptx
Load balancing in cloud computing.pptxLoad balancing in cloud computing.pptx
Load balancing in cloud computing.pptx
Hitesh Mohapatra
 
Cluster Computing
Cluster ComputingCluster Computing
Cluster Computing
Hitesh Mohapatra
 
ITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment modelITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment model
Hitesh Mohapatra
 
Leetcode Problem Solution
Leetcode Problem SolutionLeetcode Problem Solution
Leetcode Problem Solution
Hitesh Mohapatra
 
Leetcode Problem Solution
Leetcode Problem SolutionLeetcode Problem Solution
Leetcode Problem Solution
Hitesh Mohapatra
 
Trie Data Structure
Trie Data Structure Trie Data Structure
Trie Data Structure
Hitesh Mohapatra
 
Reviewing basic concepts of relational database
Reviewing basic concepts of relational databaseReviewing basic concepts of relational database
Reviewing basic concepts of relational database
Hitesh Mohapatra
 
Reviewing SQL Concepts
Reviewing SQL ConceptsReviewing SQL Concepts
Reviewing SQL Concepts
Hitesh Mohapatra
 
Advanced database protocols
Advanced database protocolsAdvanced database protocols
Advanced database protocols
Hitesh Mohapatra
 
Measures of query cost
Measures of query costMeasures of query cost
Measures of query cost
Hitesh Mohapatra
 
Involvement of WSN in Smart Cities
Involvement of WSN in Smart CitiesInvolvement of WSN in Smart Cities
Involvement of WSN in Smart Cities
Hitesh Mohapatra
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its Fundamentals
Hitesh Mohapatra
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
Hitesh Mohapatra
 

More from Hitesh Mohapatra (20)

Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Virtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud ComputingVirtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud Computing
 
Automating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine ProvisioningAutomating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine Provisioning
 
Harnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and ApplicationsHarnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and Applications
 
Scheduling in Cloud Computing
Scheduling in Cloud ComputingScheduling in Cloud Computing
Scheduling in Cloud Computing
 
Cloud-Case study
Cloud-Case study Cloud-Case study
Cloud-Case study
 
RAID
RAIDRAID
RAID
 
Load balancing in cloud computing.pptx
Load balancing in cloud computing.pptxLoad balancing in cloud computing.pptx
Load balancing in cloud computing.pptx
 
Cluster Computing
Cluster ComputingCluster Computing
Cluster Computing
 
ITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment modelITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment model
 
Leetcode Problem Solution
Leetcode Problem SolutionLeetcode Problem Solution
Leetcode Problem Solution
 
Leetcode Problem Solution
Leetcode Problem SolutionLeetcode Problem Solution
Leetcode Problem Solution
 
Trie Data Structure
Trie Data Structure Trie Data Structure
Trie Data Structure
 
Reviewing basic concepts of relational database
Reviewing basic concepts of relational databaseReviewing basic concepts of relational database
Reviewing basic concepts of relational database
 
Reviewing SQL Concepts
Reviewing SQL ConceptsReviewing SQL Concepts
Reviewing SQL Concepts
 
Advanced database protocols
Advanced database protocolsAdvanced database protocols
Advanced database protocols
 
Measures of query cost
Measures of query costMeasures of query cost
Measures of query cost
 
Involvement of WSN in Smart Cities
Involvement of WSN in Smart CitiesInvolvement of WSN in Smart Cities
Involvement of WSN in Smart Cities
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its Fundamentals
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
 

Recently uploaded

ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
Kamal Acharya
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENTNATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
Addu25809
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 
Zener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and ApplicationsZener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and Applications
Shiny Christobel
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
Dwarkadas J Sanghvi College of Engineering
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
Prakhyath Rai
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
q30122000
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 

Recently uploaded (20)

ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENTNATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 
Zener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and ApplicationsZener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and Applications
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 

Basic commands for powershell : Configuring Windows PowerShell and working with basic commands

  • 1. Automation and Configuration Management Hitesh Mohapatra Lab 1: Configuring Windows PowerShell and working with basic commands Configuring the Windows PowerShell console Configuring the Windows PowerShell ISE application Finding commands Running commands Using the About files 1. Get-Command Get-Command is an easy-to-use reference cmdlet that brings up all the commands available for use in your current session. Simply type in this command: get-command 2. Get-Help The Get-Help command is essential for anyone using PowerShell, providing quick access to the information you need to run and work with all of the available commands. Simply type in this command: Get-Help 3. Get-Service It’s also helpful to know what services are installed on the system. You can easily access this information with the following command: Simply type in this command: Get-Service If you need to know if a specific service is installed, you can append the -Name switch and the name of the service, and Windows will show the state of the service. Additionally, you can leverage filtering capabilities to return a specific subset of currently installed services. The following example will result in an output of data from the Get-Service command
  • 2. Automation and Configuration Management Hitesh Mohapatra that’s been piped to the Where-Object cmdlet, which then filters out everything other than the services that have been stopped: 4. Get-EventLog You can actually use PowerShell to parse your machine’s event logs using the Get-EventLog cmdlet. There are several parameters available. Use the -Log switch followed by the name of the log file to view a specific log. You’d use the following command, for example, to view the Application log: Simply type in this command: Get-EventLog -Log "Application" Check out a few more examples of Get-EventLog in action in this post -Verbose -Debug -ErrorAction -ErrorVariable -WarningAction -WarningVariable -OutBuffer -OutVariable 5. Get-Process Much like getting a list of available services, it’s often useful to be able to get a quick list of all the currently running processes. The Get-Process command puts this information at your fingertips. Bonus: Use Stop-Process to stop processes that are frozen or is no longer responding. If you’re not sure what process is holding you up, use Get- Process to quickly identify the problematic process. Once you have the name or process ID, use Stop-Process to terminate it. Here’s an example. Run this command to terminate all currently running instances of Notepad:
  • 3. Automation and Configuration Management Hitesh Mohapatra Stop-Process -processname notepad You can use wildcard characters, too, such as the following example which terminates all instances of Notepad as well as any other processes beginning with note: Stop-Process -processname note* 6. Clear-History What if you want to clear the entries from your command history? Easy – use the Clear-History cmdlet. You can also use it to delete only specific commands. For example, the following command would delete commands that include “help” or end in “command” PS C:> Clear-History -Command *help*, *command If you want to add entries to a session, use: Add-History 7. Set-ExecutionPolicy Although you can create and execute PowerShell scripts, Microsoft has disabled scripting by default in an effort to prevent malicious code from executing in a PowerShell environment. You can use the Set- ExecutionPolicy command to control the level of security surrounding PowerShell scripts. Four levels of security are available to you: Restricted -- Restricted is the default execution policy and locks PowerShell down so that commands can be entered only interactively. PowerShell scripts are not allowed to run. All Signed -- If the execution policy is set to All Signed then scripts will be allowed to run, but only if they are signed by a trusted publisher. Remote Signed -- If the execution policy is set to Remote Signed, any PowerShell scripts that have been locally created will be allowed to run. Scripts created remotely are allowed to run only if they are signed by a trusted publisher. Unrestricted -- As the name implies, Unrestricted removes all restrictions from the execution policy.
  • 4. Automation and Configuration Management Hitesh Mohapatra You can set an execution policy by entering the Set-ExecutionPolicy command followed by the name of the policy. For example, if you wanted to allow scripts to run in an unrestricted manner you could type: Set-ExecutionPolicy Unrestricted 8. Get-EventLog You can actually use PowerShell to parse your computer's event logs. There are several parameters available, but you can try out the command by simply providing the -Log switch followed by the name of the log file. For example, to see the Application log, you could use the following command: Get-EventLog -Log "Application" Of course, you would rarely use this command in the real world. You're more likely to use other commands to filter the output and dump it to a CSV or an HTML file. 9. Select-Object If you tried using the command above, you know that there were numerous properties included in the CSV file. It's often helpful to narrow things down by including only the properties you are really interested in. This is where the Select-Object command comes into play. The Select- Object command allows you to specify specific properties for inclusion. For example, to create a CSV file containing the name of each system service and its status, you could use the following command: Get-Service | Select-Object Name, Status | Export-CSV c:service.csv Command alias Cmdlet name Description of command
  • 5. Automation and Configuration Management Hitesh Mohapatra % ForEach-Object Performs an operation against each item in a collection of input objects. ? Where-Object Selects objects from a collection based on their property values. ac Add-Content Appends content, such as words or data, to a file. asnp Add-PSSnapIn Adds one or more Windows PowerShell snap-ins to the current session. cat Get-Content Gets the contents of a file. cd Set-Location Sets the current working location to a specified location. chdir Set-Location Sets the current working location to a specified location. clc Clear-Content Deletes the contents of an item, but does not delete the item. clear Clear-Host Clears the display in the host program. clhy Clear-History Deletes entries from the command history. cli Clear-Item Deletes the contents of an item, but does not delete the item. clp Clear-ItemProperty Deletes the value of a property but does not delete the property. cls Clear-Host Clears the display in the host program. clv Clear-Variable Deletes the value of a variable.
  • 6. Automation and Configuration Management Hitesh Mohapatra cnsn Connect-PSSession Reconnects to disconnected sessions compare Compare-Object Compares two sets of objects. copy Copy-Item Copies an item from one location to another. cp Copy-Item Copies an item from one location to another. cpi Copy-Item Copies an item from one location to another. cpp Copy-ItemProperty Copies a property and value from a specified location to another location. curl Invoke-WebRequest Gets content from a webpage on the Internet. cvpa Convert-Path Converts a path from a Windows PowerShell path to a Windows PowerShell provider path. dbp Disable-PSBreakpoint Disables the breakpoints in the current console. del Remove-Item Deletes files and folders. diff Compare-Object Compares two sets of objects. dir Get-ChildItem Gets the files and folders in a file system drive. dnsn Disconnect-PSSession Disconnects from a session. ebp Enable-PSBreakpoint Enables the breakpoints in the current console. echo Write-Output Sends the specified objects to the next command in the pipeline. If the command is the last command in the pipeline, the objects are displayed in the console.
  • 7. Automation and Configuration Management Hitesh Mohapatra epal Export-Alias Exports information about currently defined aliases to a file. epcsv Export-Csv Converts objects into a series of comma-separated (CSV) strings and saves the strings in a CSV file. epsn Export-PSSession Imports commands from another session and saves them in a Windows PowerShell module. erase Remove-Item Deletes files and folders. etsn Enter-PSSession Starts an interactive session with a remote computer. exsn Exit-PSSession Ends an interactive session with a remote computer. fc Format-Custom Uses a customized view to format the output. fl Format-List Formats the output as a list of properties in which each property appears on a new line. foreach ForEach-Object Performs an operation against each item in a collection of input objects. ft Format-Table Formats the output as a table. fw Format-Wide Formats objects as a wide table that displays only one property of each object. gal Get-Alias Gets the aliases for the current session. gbp Get-PSBreakpoint Gets the breakpoints that are set in the current session. gc Get-Content Gets the contents of a file.
  • 8. Automation and Configuration Management Hitesh Mohapatra gci Get-ChildItem Gets the files and folders in a file system drive. gcm Get-Command Gets all commands. gcs Get-PSCallStack Displays the current call stack. gdr Get-PSDrive Gets drives in the current session. ghy Get-History Gets a list of the commands entered during the current session. gi Get-Item Gets files and folders. gjb Get-Job Gets Windows PowerShell background jobs that are running in the current session. gl Get-Location Gets information about the current working location or a location stack. gm Get-Member Gets the properties and methods of objects. gmo Get-Module Gets the modules that have been imported or that can be imported into the current session. gp Get-ItemProperty Gets the properties of a specified item. gps Get-Process Gets the processes that are running on the local computer or a remote computer. group Group-Object Groups objects that contain the same value for specified properties. gsn Get-PSSession Gets the Windows PowerShell sessions on local and remote computers.
  • 9. Automation and Configuration Management Hitesh Mohapatra gsnp Get-PSSnapIn Gets the Windows PowerShell snap-ins on the computer. gsv Get-Service Gets the services on a local or remote computer. gu Get-Unique Returns unique items from a sorted list. gv Get-Variable Gets the variables in the current console. gwmi Get-WmiObject Gets instances of Windows Management Instrumentation (WMI) classes or information about the available classes. h Get-History Gets a list of the commands entered during the current session. history Get-History Gets a list of the commands entered during the current session. icm Invoke-Command Runs commands on local and remote computers. iex Invoke-Expression Runs commands or expressions on the local computer. ihy Invoke-History Runs commands from the session history. ii Invoke-Item Performs the default action on the specified item. ipal Import-Alias Imports an alias list from a file. ipcsv Import-Csv Creates table-like custom objects from the items in a CSV file. ipmo Import-Module Adds modules to the current session.
  • 10. Automation and Configuration Management Hitesh Mohapatra ipsn Import-PSSes sion Imports commands from another session into the current session. irm Invoke-RestMethod Sends an HTTP or HTTPS request to a RESTful web service. ise powershell_ise.exe Explains how to use the PowerShell_ISE.exe command-line tool. iwmi Invoke-WMIMethod Calls Windows Management Instrumentation (WMI) methods. iwr Invoke-WebRequest Gets content from a web page on the Internet. kill Stop-Process Stops one or more running processes. lp Out-Printer Sends output to a printer. ls Get-ChildItem Gets the files and folders in a file system drive. man help Displays information about Windows PowerShell commands and concepts. md mkdir Creates a new item. measure Measure-Object Calculates the numeric properties of objects, and the characters, words, and lines in string objects, such as files of text. mi Move-Item Moves an item from one location to another. mount New-PSDrive Creates temporary and persistent mapped network drives. move Move-Item Moves an item from one location to another.
  • 11. Automation and Configuration Management Hitesh Mohapatra mp Move-ItemProperty Moves a property from one location to another. mv Move-Item Moves an item from one location to another. nal New-Alias Creates a new alias. ndr New-PSDrive Creates temporary and persistent mapped network drives. ni New-Item Creates a new item. nmo New-Module Creates a new dynamic module that exists only in memory. npssc New- PSSessionConfigurationFile Creates a file that defines a session configuration. nsn New-PSSession Creates a persistent connection to a local or remote computer. nv New-Variable Creates a new variable. ogv Out-GridView Sends output to an interactive table in a separate window. oh Out-Host Sends output to the command line. popd Pop-Location Changes the current location to the location most recently pushed to the stack. You can pop the location from the default stack or from a stack that you create by using the Push- Location cmdlet. ps Get-Process Gets the processes that are running on the local computer or a remote computer. pushd Push-Location Adds the current location to the top of a location stack.
  • 12. Automation and Configuration Management Hitesh Mohapatra pwd Get-Location Gets information about the current working location or a location stack. r Invoke-History Runs commands from the session history. rbp Remove-PSBreakpoint Deletes breakpoints from the current console. rcjb Receive-Job Gets the results of the Windows PowerShell background jobs in the current session. rcsn Receive-PSSession Gets results of commands in disconnected sessions. rd Remove-Item Deletes files and folders. rdr Remove-PSDrive Deletes temporary Windows PowerShell drives and disconnects mapped network drives. ren Rename-Item Renames an item in a Windows PowerShell provider namespace. ri Remove-Item Deletes files and folders. rjb Remove-Job Deletes a Windows PowerShell background job. rm Remove-Item Deletes files and folders. rmdir Remove-Item Deletes files and folders. rmo Remove-Module Removes modules from the current session. rni Rename-Item Renames an item in a Windows PowerShell provider namespace. rnp Rename-ItemProperty Renames a property of an item. rp Remove-ItemProperty Deletes the property and its value from an item.
  • 13. Automation and Configuration Management Hitesh Mohapatra rsn Remove-PSSession Closes one or more Windows PowerShell sessions (PSSessions). rsnp Remove-PSSnapin Removes Windows PowerShell snap- ins from the current session. rujb Resume-Job Restarts a suspended job rv Remove-Variable Deletes a variable and its value. rvpa Resolve-Path Resolves the wildcard characters in a path, and displays the path contents. rwmi Remove-WMIObject Deletes an instance of an existing Windows Management Instrumentation (WMI) class. sajb Start-Job Starts a Windows PowerShell background job. sal Set-Alias Creates or changes an alias (alternate name) for a cmdlet or other command element in the current Windows PowerShell session. saps Start-Process Starts one or more processes on the local computer. sasv Start-Service Starts one or more stopped services. sbp Set-PSBreakpoint Sets a breakpoint on a line, command, or variable. sc Set-Content Replaces the contents of a file with contents that you specify. select Select-Object Selects objects or object properties. set Set-Variable Sets the value of a variable. Creates the variable if one with the requested name does not exist.
  • 14. Automation and Configuration Management Hitesh Mohapatra shcm Show-Command Creates Windows PowerShell commands in a graphical command window. si Set-Item Changes the value of an item to the valu References: 1. https://serverfault.com/questions/683942/use-powershell-to-create-a-web-page-from-an-array 2. https://devblogs.microsoft.com/scripting/use-the-powershell-group-object-cmdlet-to-display- data/ 3. https://docs.microsoft.com/en-us/powershell/module/nettcpip/set-netipaddress?view=win10- ps 4. https://devblogs.microsoft.com/scripting/order-your-output-by-easily-sorting-objects-in- powershell/