Skip to content

Instantly share code, notes, and snippets.

@chriswessells
Last active August 29, 2015 13:56
Show Gist options
  • Save chriswessells/9160211 to your computer and use it in GitHub Desktop.
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
<#
.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