Windows Powershell Notes

PS C:\> Get-ExecutionPolicy
if restricted

PS C:\> Set-ExecutionPolicy RemoteSigned

From dos : powershell c:\monscript.ps1

$cred = Get-Credential -Credential contoso\administrator
Get-WinEvent -LogName System -ComputerName NomDeMachine -Credential $cred

Il est bien évidement possible d’exécuter un script powershell depuis l’interpréteur Powershell en tapant la commande suivante:
.\nomduscript.ps1

$computers = “c1″,”c2”
Write-Output $computers
Write-Output $pingreturns[1]

==========================================

Get-BiosVersionUseArray.ps1

$computers = “hyperv”,”hyperv-box”

Get-WmiObject -Class win32_bios -cn $computers |

Format-table __Server, Manufacturer, Version -AutoSize

==========================================

Get-BiosVersionQueryAD.ps1

Import-Module -Name ActiveDirectory

Get-ADComputer -filter * |

Foreach-Object {

Get-WmiObject -Class win32_bios -cn $_.name -EA silentlyContinue |

Select-Object __Server, Manufacturer, Version } |

Format-Table -Property * -AutoSize

=====================================

 

extradrmtech

Since 30 years I work on Database Architecture and data migration protocols. I am also a consultant in Web content management solutions and medias protecting solutions. I am experienced web-developer with over 10 years developing PHP/MySQL, C#, VB.Net applications ranging from simple web sites to extensive web-based business applications. Besides my work, I like to work freelance only on some wordpress projects because it is relaxing and delightful CMS for me. When not working, I like to dance salsa and swing and to have fun with my little family.

You may also like...