Webcast Windows PowerShell

Olá pessoal,

Hoje fizemos mais um webcast para o Technet Brasil falando somente sobre Windows PowerShell, isto mesmo o assunto hoje não foi Exchange🙂

Para os que ficaram com dúvidas em alguns cmdlets eu coloquei todos os cmdlets utilizados durante o webcast para ajudar nos entendimento do produto, como segue:

Demo 01:
– Abrir o Windows Powershell

– get-command

– get-help

– get-process

– get-help get-process

– get-help get-process -detailed

– get-help get-process -full

recebe notes

– man get-process

– get-eventlog

– escrever Application

– get-eventlog "Windows PowerShell"

– abrir o eventviewer

DEMO 02
– get-service

– format-list

– get-service | format-list

– get-service | format-table

– get-service | format-wide

– get-service | Where-Object { $_.Status -eq "running" }

– get-service | Where-Object { $_.Status -eq "running" } | export-csv a.txt

– Abrir o Excel e mostrar

– get-service t*

– start-service t*

– get-service -name t* -exclude tln*

– get-eventlog -logname system -newest 10

– get-eventlog -logname system -Newest 10 | where-object { $_.EntryType -eq "Information" }

– get-eventlog -logname system -Newest 10 | where-object { $_.EntryType -eq "error" } | fl

– get-alias

– gps

– set-alias poa get-process

– poa

– fechar powershell

– poa <erro>

– set-alias poa get-process

– export-alias -path alias.txt

– notepad alias.txt

– import-alias alias.txt

– export-alias -path alias.txt -name poa

– notepad alias.txt

– Test-Path $Profile

– abrir o d:\personal\windowspowershell\_Microsoft.PowerShell_profile.ps1

– mostrar os cmdlets

– rodar novamente test-path $Profile

– <fechar> e abrir o powershell e rodar poa

– $var1 = 5

– $var2 = 10

– $var1 + $var2

– if ($var1 -gt $var2) {write-host $var1} else {write-host $var2}

– mostrar o x.vbs na raiz do c:

– cscript x.vbs

– abir um notepad e colocar o seguinte codigo

$var1 = 5

$var2 = 10

$var1 + $var2

if ($var1 -gt $var2) {write-host "maior é" $var1} else {write-host "maior é" $var2}

– notepad xyz.ps1

– colar o texto

– rodar o ./xyz.ps1

– get-executionpolicy

INFO: – set-executionpolicy restricted

INFO: – set-executionpolicy unrestricted

– get-wmiobject win32_process

 

Grande abraço,
Anderson Patricio
http://www.andersonpatricio.org

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: