In this session, We will learn how you can control the result or output of command prompt & will also learn few more commands-
If you are new to PowerShell, Please read previous blog Introduction to Windows PowerShell (Part1)
You can start from command prompt or from PowerShell-
Now Control the result of cmd prompt-
All files & commands have few properties, few methods are associated with them, You can check it with get-member or gm
For eg : PS C:\> dir | ?{$_.Name -match “dba”} | gm Now you can use these properties & methods.
It is difficult to explain all commands & attributes of a tool. My main aim is to provide concept & few practical knowledge on this.
=========================================================================================================================
Variables :
YOU can define any thing on $<variable name>
Few more concepts related to DateTime
Date command will work on CMD & PowerShell
Time command will work on cmd & will give error on PowerShell- for time you need date -displayhint time
Get-Date -format “dd-MMM-yyyy HH:mm”
(Get-Date).AddDays(-1)
Get-Date | Select-Object -ExpandProperty DayOfWeek
Few more commands you can use-
(get-date).day
(get-date).dayofweek
(get-date).dayofyear
(get-date).hour
(get-date).millisecond
(get-date).minute
(get-date).month
(get-date).second
(get-date).timeofday
(get-date).year
We will learn creating scripts , executing them & few more concepts in next session-
Please give us your feedback on : vimal.lohani@gmail.com
One response to “Introduction to Windows PowerShell (Part2)”
[…] Introduction to Windows PowerShell (Part2) […]