Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block aaronk1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aaronk1 / get_powershell_version.ps1
Last active Nov 22, 2016
View get_powershell_version.ps1
# Supports Windows 2012 R2 and up. Ensure you have Local Administrator access and network connectivity to the target servers for whatever account runs this.
Function ConfirmState
if($truetext -eq $null){$truetext = "$confirm_feature was successfully installed!"}
if($falsetext -eq $null){$falsetext = "ERROR!!! $confirm_feature was NOT INSTALLED!"}
$installstate = Get-WindowsOptionalFeature -Online -FeatureName $confirm_feature
if($installstate.state -Like "Enabled"){$truetext| %{ Write-Host -foreground "green" $_; $_ } | Out-File $log_file -Append}else{$falsetext | %{ Write-Host -foreground "red" $_; $_ } | Out-File $log_file -Append}
You can’t perform that action at this time.