Monday 5 December 2011

Powershell abc

cls        clear screen
notepad  runs notepad
get-process notepad |Format-list * |more         shows the list of process having name of notepad and shows all attached properties, |more is used for paging

get-process |Format-table -property-name name,starttime |more   shows the table of processes, the property which are not shown are because of privileges of currently running powershell user.



get-process | where-object { $_.starttime } |Format-table -property-name name,starttime 
shows the table of processes having value of starttime

gps | ?{$_.starttime} |ft name,starttime

this command is equivalent to above used command

Get-Alias
lists the all the alias

Get-help Get-Alias
-----

Get-Services | where {$_.status eq 'running'}

list of all the services that are running

Get-Services | where {$_.canPauseAndContinue}
---------

Get-Command -Noun Service

get-help set-service

Set-Service -Name lanmanservice -Status paused

------------
stop-process processid

-----
get-process | sort name
-----------------------
Get-EventLog -List

Get-EventLog -LogName 'windows powershell' newest 5 |Formatlist *

Get-EventLog -LogName 'windows powershell' where ($_.message -match 'wmi')
the above commands do the wildcard matching

Get-EventLog -LogName 'windows powershell' -source 'xyz'

Get-EventLog -LogName 'windows powershell' -source 'xyz' -After '3/8/11'


1 comment:

  1. i am a successful business owner and father. I got one of these already programmed blank ATM cards that allows me withdraw a maximum of $5,000 daily for 30 days. I am so happy about these cards because I received mine last week and have already used it to get $20,000. Skylink technology is giving out these cards to support people in any kind of financial problem. I must be sincere to you, when i first saw the advert, I believed it to be illegal and a hoax but when I contacted this team, they confirmed to me that although it is illegal, nobody gets caught while using these cards because they have been programmed to disable every communication once inserted into any Automated Teller Machine(ATM). If interested get through to them on mail: skylinktechnes@yahoo.com  or  whatsapp/telegram: +1(213)785-1553  

    ReplyDelete