Last active
August 29, 2015 13:56
-
-
Save chriswessells/9160211 to your computer and use it in GitHub Desktop.
PowerShell start of a script that get's the Operating System version and architecture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Beginning of a script to do things specific to the Windows Operating System | |
.DESCRIPTION | |
I automate tasks often in a windows environment. This script can be customized for all Windows Operating Systems. | |
.NOTES | |
Author : Chris Wessells (chris@wessells.me) | |
.LINK | |
Script posted over: | |
http://wessells.me | |
#> | |
$currentHost = new-object system.collections.arraylist; | |
$currentHost.add((get-wmiobject win32_operatingsystem).name); | |
$currentHost.add((get-wmiobject win32_operatingsystem).osarchitecture); | |
# What to do for Windows 7 | |
if ($currentHost[0] -like "*Windows 7*") { | |
} | |
# What to do for Windows XP | |
if ($currentHost[0] -like "*Windows XP*") { | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment