I want to be able to check a few things like if it is running powershell in an elevated mode or a particular user account is being used
e.g
Powershell
If(-NOT([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")){Write-Warning"Powershell is not running as Administrator! Please re-run this script in powershell in Administrator Mode! "Exit}
How would I go about this (if at all) given the sample powershell script below as an example?
Powershell
Param(# Pass the Server name [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=0)]$ServerName)Begin{}Process{# This is a simple get of all instances of CCM_SoftwareUpdate from root\CCM\ClientSDK $MissingUpdates=Get-WmiObject-ClassCCM_SoftwareUpdate...