About us

IIS covers the IT solutions to the issues come across now and then in a company IT infrastructure including Operating system, Softwares, Scriptings, securities and reviews.

Thursday, 6 March 2014

PowerShell Scripts - Functions Definition

Have Created one function which will fetch Operating Information for multiple computers.

Change the text file name accordingly.

Function Get-Osinfo {
BEGIN{}
Process{
                $computername = $_
                Get-wmiobject –class win32_operatingsystem –computer $computername | select-object BuildNumber, Caption, ServicePackMajorVersion
}
END{}
}

Get-content C:\computers.txt | get-osinfo

Regards
Baij

No comments:

Post a Comment