PowerShell Function: Get-LocalWeather

Just a quick note here, you NEED to read the Comment Based Help for this function (especially if you are querying sites outside the US).

    ##--------------------------------------------------------------------------
    ##  FUNCTION.......:  Get-LocalWeather
    ##  PURPOSE........:  Queries the nearest airport for local weather 
    ##                    conditions.
    ##  REQUIREMENTS...:  Internet connection
    ##  NOTES..........:  
    ##--------------------------------------------------------------------------
    Function Get-LocalWeather {
        ##----------------------------------------------------------------------
        ##  Comment Based Help for this function.
        ##----------------------------------------------------------------------

        <#
        .SYNOPSIS
         Queries the nearest airport for local weather conditions.
        .DESCRIPTION
         This function uses webservicex.com to query data from airports and 
         weather observatories for local weather conditions.
        .PARAMETER Site
         Name of the Airport or weather observatory to query.

         ALIAS:  -s
        .PARAMETER ListAll
         This optional switch returns a list of all available airports and 
         weather observatories available in the selected country (default is the
         United States).

         ALIAS:  -l
        .PARAMETER TempF
         This optional switch returns only the temperature (in Fahrenheit) for 
         the specified location.

         ALIAS:  -tf
        .PARAMETER TempC
         This optional switch returns only the temperature (in Celsius) for the
         specified location.

         ALIAS:  -tc
        .Parameter Humidity
         This optional switch returns only the relative humidity for the 
         specified location.

         ALIAS:  -h
        .PARAMETER CountryName
         This optional parameter changes the Country queried (the default is the
         United States). 

         NOTE:
         If you are querying a data source outside the US, you MUST use this 
         parameter.

         ALIAS:  -c
        .EXAMPLE
         C:\PS>Get-LocalWeather "Knoxville"

         This will return the current weather conditions at the Knoxville 
         Airport.

        .EXAMPLE
         C:\PS>"Knoxville" | Get-LocalWeather

         This will return the current weather conditions at the Knoxville 
         Airport using pipelining.

        .EXAMPLE
         C:\PS>Get-LocalWeather -l | More

         This Example will display a list of all available Airports / Weather 
         Observatories in the US (I piped it to More because there are many).

        .EXAMPLE
         C:\PS>Get-LocalWeather -l -c "Canada" | More

         This Example will display a list of all available Airports / Weather 
         Observatories in Canada (I piped it to More because there are many).

        .EXAMPLE 
         C:\PS>Get-LocalWeather "Wyton" -c "United Kingdom"

         This example will return weather data for the Wyton airport in the UK.

        .NOTES
         NAME......:  Get-LocalWeather
         AUTHOR....:  Joe Glessner
         LAST EDIT.:  25JAN13
         CREATED...:  03DEC12
        .LINK
         https://joeit.wordpress.com/
        #>

        ##----------------------------------------------------------------------
        ##  Function Parameters.
        ##----------------------------------------------------------------------
        Param([Parameter(Mandatory = $False,
            ValueFromPipeLine = $True,
            Position = 0)]
            [Alias('s')]
            [String]$Site,
            [Parameter(Mandatory = $False)]
            [Alias('c')]
            [String]$CountryName,
            [Parameter(Mandatory = $False)]
            [Alias('l')]
            [Switch]$ListAll,
            [Parameter(Mandatory = $False)]
            [Alias('tf')]
            [Switch]$TempF,
            [Parameter(Mandatory = $False)]
            [Alias('tc')]
            [Switch]$TempC,
            [Parameter(Mandatory = $False)]
            [Alias('h')]
            [Switch]$Humidity
        )#END: Param

        Begin {
            $URL = 'http://www.webservicex.com/globalweather.asmx?WSDL'
            $weather = New-WebServiceProxy -Uri $URL
            If ($CountryName) {
                $Co = $CountryName
            } #END: If ($CountryName)
            Else {
                $Co = 'United States'
            } #END: Else
            Write-Verbose "$Site"
            Write-Verbose "$Co"
        } #END: Begin
        Process {
            If ($ListAll) {
                $List = `
                ([xml]$weather.GetCitiesByCountry($Co)).NewDataSet.Table | 
                Select-Object -ExpandProperty City
                $List
            } #END: If ($ListAll)
            If (!(($Site) -or ($ListAll))) {
                Write-Warning "You must enter the exact location name for your"
                Write-Warning "desired Airport/observatory."
                Write-Warning ""
                Write-Warning "Use the -l switch to get a list of valid site"
                Write-Warning "names."
            } #END: If (!($Site))
            Else {
                Write-Verbose "If you see a Type conversion error here, either"
                Write-Verbose "your query was incorrect, or there is no data"
                Write-Verbose "for the site you queried."
                $Data = ([xml]$weather.GetWeather($Site,$Co)).CurrentWeather  
            } #END: Else
            If ($TempF) {
                $Temp = ($Data.Temperature -split '\(')[0]
                $Temp.TrimStart()
                Break;
            } #END: ($TempF)
            If ($TempC) {
                $Temp = ($Data.Temperature -split '[\(\)]')[1]
                $Temp.TrimStart()
                Break;
            } #END: If ($TempC)
            If ($Humidity) {
                $Data.RelativeHumidity.TrimStart()
                Break;
            } #END: If ($Humidity)
            ElseIf ($Site) {
                $Data
            } #END: If ($Site)
        }#END: Process
    } #END: Function Get-LocalWeather

end.jpg

PowerShell Function: Get-ADLogin

    ##--------------------------------------------------------------------------
    ##  FUNCTION.......:  Get-ADLogin
    ##  PURPOSE........:  Returns the specified user's SAM Account Name.
    ##  REQUIREMENTS...:  Active Directory
    ##  NOTES..........:  
    ##--------------------------------------------------------------------------
    Function Get-ADLogin {
        ##----------------------------------------------------------------------
        ##  Comment Based Help for this function.
        ##----------------------------------------------------------------------

        <#
        .SYNOPSIS
         Returns the specified user's SAM account Name.
        .DESCRIPTION
         This function accepts the user's Display Name, and returns the SAM 
         Account name for the user. Defaults to search the "Users" OU.
        .PARAMETER Usr
         The user's Active Directory Display Name.
        .PARAMETER All
         This optional switch will return the SAM account name for the first
         1000 users in the "Users" OU in Active Directory.
        .EXAMPLE
         C:\PS>Get-ADLogin "Test User"

         This will return the SAM account name for the user account with a 
         Display Name of "Test User".

        .EXAMPLE
         C:\PS>"Test User" | Get-ADLogin

         This example does the same thing as Example 1, only using pipelining.

        .NOTES
         NAME......:  Get-ADLogin
         AUTHOR....:  Joe Glessner
         LAST EDIT.:  03DEC12
         CREATED...:  11APR11
        .LINK
         https://joeit.wordpress.com/
        #>

        ##----------------------------------------------------------------------
        ##  Function Parameters.
        ##----------------------------------------------------------------------
        Param([Parameter(Mandatory = $False,
            ValueFromPipeLine = $True,
            Position = 0)]
            [Alias('u')]
            [String]$Usr,
            [Parameter(Mandatory = $False,
                ValueFromPipeLine = $True,
                Position = 1)]
            [Switch]$All
        )#END: Param

        $filter = "(&(objectCategory=person)(objectClass=user)(name=$Usr))"
        $root = New-Object `
            System.DirectoryServices.DirectoryEntry("LDAP://RootDSE")
        If ($All) {
            $searcher = New-Object System.DirectoryServices.DirectorySearcher
        }
        Else {
            $searcher = New-Object `
            System.DirectoryServices.DirectorySearcher $filter
        }
        $SearchRoot = $root.defaultNamingContext
        $searcher.SearchRoot = "LDAP://CN=Users,$SearchRoot"
        $searcher.SearchScope = 'SubTree'
        $searcher.SizeLimit = 0
        $searcher.PageSize = 1000
        $searcher.FindAll() | ForEach-Object {
            $account = $_.GetDirectoryEntry()
            $info = $account.SamAccountName[0]
            $info
        }#END: ForEach-Object
    }#END: Function Get-ADLogin

PowerShell Function: Get-Sysinternals

    ##--------------------------------------------------------------------------
    ##  FUNCTION.......:  Get-Sysinternals
    ##  PURPOSE........:  Downloads or updates the Sysinternal Utilities.
    ##  REQUIREMENTS...:  PowerShell 2.0
    ##  NOTES..........:  
    ##--------------------------------------------------------------------------
    Function Get-Sysinternals {
        <#
        .SYNOPSIS
         Downloads or updates the Sysinternals Utilities. For examples type:
         Get-Help Get-Sysinternals -examples
        .DESCRIPTION
         The Get-Sysinternals Function uses file timestamps to determine if 
         there are updates or (optionally) new utilities available from 
         live.sysinternals.com, if there are they will be downloaded and saved 
         in the specified directory.
         This function will also log all output to whatever directory is 
         specified by the -Path parameter (by default this is 
         "c:\admin\tools\logfile.txt").
        .PARAMETER <Path>
         This optional parameter defines the location of your Sysinternals 
         Utilities, or where they will be saved if none are present. The default
         value is "c:\admin\tools". If you specify a path that does not exist, 
         it will be created. If a trailing slash is used in the path, the 
         operation will fail.
        .PARAMETER <getnew>
         This optional parameter will get any utilities that are available on 
         live.sysinternals.com, which do not exist in the specified directory.
        .EXAMPLE
         C:\PS>Get-Sysinternals
         
         This example will check the directory "c:\admin\tools" for existing 
         Sysinternals utilities and update any with newer verisons.
         
        .EXAMPLE
         C:\PS>Get-Sysinternals c:\sysinternals
         
         This example will do the same thing as Example 1, but using the 
         "c:\sysinternals" folder.
         
        .EXAMPLE
         C:\PS>Get-Sysinternals c:\sysinternals -verbose
         
         This example will do the same thing as Example 2, but will also write 
         verbose output to the console.
         
        .EXAMPLE
         C:\PS>Get-Sysinternals c:\sysinternals -getnew -verbose
         
         This example will do the same thing as Example 3, but will also 
         download any utilities that are available on live.sysinternals.com, 
         but which do not exist in the specified path.
        
        .NOTES
         NAME......:  Get-Sysinternals
         AUTHOR....:  Joe Glessner
         LAST EDIT.:  24MAY12
         CREATED...:  11APR11
        .LINK
         https://joeit.wordpress.com/
        #>
        [CmdletBinding()]
        Param(
            [Parameter(Mandatory=$False, 
                        Position=0,                           
                        ValueFromPipeline=$false,             
                        ValueFromPipelineByPropertyName=$false)]
            [String]$Path = "c:\admin\tools",
            [Switch]$GetNew
        )#END: Param
        $SysIn = "\\live.sysinternals.com\tools"
        If ($PSBoundParameters['Verbose']) {
            net use $SysIn /persistent:no;
            New-PSDrive -Name SYS -PSProvider filesystem -Root $SysIn
        }#END: If ($PSBoundParameters['Verbose'])
        Else {
            Net Use $SysIn /persistent:no | Out-Null;
            New-PSDrive -Name SYS -PSProvider filesystem -Root $SysIn | out-null
        }#END: Else
        If(!(Test-Path -Path $Path -PathType Container)) {
            $null = New-Item -Type Directory -Path $Path -Force
        }#END: If(!(Test-Path...
        $log = join-path $Path "logFile.txt"
        Write-Verbose "Logging to: $log"
        Add-Content -force $log -value "`n`n[$(get-date)]Update started..."
        Get-ChildItem SYS: -recurse | ForEach {
            $fileName = $_.name
            $localFile = join-path $Path $_.name
            $exist = test-path $localFile
            $msgNew = "  ** New utility found: $fileName , downloading..."
            $msgUpdate = "  ** Update found for: $fileName , downloading..."
            $msgNoChange = "    No update for: $fileName"
            If($exist) {
                If($_.lastWriteTime -gt (Get-Item $localFile).lastWriteTime) {
                    Copy-Item $_.fullname $Path -force
                    Write-Verbose $msgUpdate
                    Add-Content -force $log -value $msgUpdate
                 }#END: ($_.lastWriteTime...
                Else {
                    Add-Content $log -force -value $msgNoChange
                    Write-Verbose $msgNoChange
                 }#END: Else
            }#END: If($exist)
            If($GetNew) {
                If(!($exist)) {
                    If($_.extension -eq ".exe") {
                          Write-Verbose $msgNew
                          Add-Content -force $log -value $msgNew
                     }#END: If($_.extension -eq ".exe")
                    Copy-Item $_.fullname $Path -force
                }#END: If(!($exist))
            }#END: If($GetNew)
        }#END: Get-ChildItem SYS: -recurse | ForEach
        Write-Verbose "[$(get-date)]Update completed."
        Add-Content -force $log -value "`n`n[$(get-date)]Update completed."
    }#END: Function Get-Sysinternals

 

PowerShell Function: Get-MD5Checksum

    ##--------------------------------------------------------------------------
    ##  FUNCTION.......:  Get-MD5Checksum
    ##  PURPOSE........:  Generates an MD5 checksum for the specified file.
    ##  REQUIREMENTS...:  PowerShell v2
    ##  NOTES..........:  
    ##--------------------------------------------------------------------------
    Function Get-MD5Checksum {
        <#
        .SYNOPSIS
         Generates an MD5 checksum for the specified file.
        .DESCRIPTION
         This function uses the 
         System.Security.Cryptography.MD5CryptoServiceProvider .NET class to
         generate and retun an MD5 checksum for the specified file.
        .PARAMETER FileName
         The filename including path for which to generate the MD5 sum.

         ALIAS: -f
        .EXAMPLE
         C:\PS>Get-MD5Checksum c:\test.txt

         This will return an MD5 checksum for the file c:\test.txt

        .EXAMPLE
         C:\PS>"C:\TEST\test.csv" | Get-MD5Checksum

         This will also return an MD5 checksum for the file c:\test.txt, passing
         the FileName to the function using pipelining.

        .NOTES
         NAME......:  Get-MD5Checksum
         AUTHOR....:  Joe Glessner
         LAST EDIT.:  14MAY12
         CREATED...:  11APR08
        .LINK
         https://joeit.wordpress.com/
        #>

        Param([Parameter(Mandatory = $True,
            ValueFromPipeLine = $True,
            Position = 0)]
            [Alias('f')]
            [String]$FileName
        )#END: Param

        $MD5 = New-Object System.Security.Cryptography.MD5CryptoServiceProvider
        If([System.IO.File]::Exists($FileName)) {
            $FileStream = New-Object System.IO.FileStream($FileName,`
            [System.IO.FileMode]::Open,[System.IO.FileAccess]::Read,`
            [System.IO.FileShare]::ReadWrite)
            [byte[]]$ByteSum = $MD5.ComputeHash($FileStream)
            $Sum = ([System.Bitconverter]::ToString($ByteSum)).Replace("-","")
            $FileStream.Close()
        }#END: If([System.IO.File]::Exists($fileName))
        Else {
            $Sum = "ERROR: $FileName Not Found"
        }#END: Else
        Return $Sum
    }#END: Function Get-MD5Checksum

PowerShell Function: Reset-Module

    ##--------------------------------------------------------------------------
    ##  FUNCTION.......:  Reset-Module
    ##  PURPOSE........:  Removes and then imports the specified PowerShell 
    ##                    Module.
    ##  REQUIREMENTS...:  The Module must be registered with the shell.
    ##  NOTES..........:  
    ##--------------------------------------------------------------------------
    Function Reset-Module {
        <#
        .SYNOPSIS
         Removes and then re-imports the specified PowerShell Module.
         For examples type:
         Help Reset-Module -examples
        .DESCRIPTION
         Removes and then re-imports the specified PowerShell Module.
        .PARAMETER ModuleName
         The Name of the Module to reload.
        .EXAMPLE
         C:\PS>Reload-Module TroubleshootingPack

         This example will reload the TroubleshootingPack module. This example
         will produce no visible output.

        .EXAMPLE
         C:\PS>Reload-Module TroubleshootingPack -verbose

         This example does the same thing as Example 1, but will also write 
         verbose output to the console.

        .NOTES
         NAME......:  Reset-Module
         AUTHOR....:  Joe Glessner
         LAST EDIT.:  19MAY11
         CREATED...:  19MAY11
        .LINK
         about_Modules
         https://joeit.wordpress.com/
        #>
        [CmdletBinding()]             
            Param (                        
                [Parameter(Mandatory=$True, 
                    #ValueFromPipeline=$True,
                    #ValueFromPipelineByPropertyName=$True,
                    Position=0)]  
                [String]$ModuleName
                )#End Param
        Write-Verbose "Removing Module $ModuleName"
        Remove-Module $ModuleName
        Start-Sleep -s 1
        Write-Verbose "Importing Module $ModuleName"
        Import-Module $ModuleName
    }#END: Module Reset-Module

PowerShell Function: Set-RunOnce

    ##--------------------------------------------------------------------------
    ##  FUNCTION.......:  Set-RunOnce
    ##  PURPOSE........:  Changes the RunOnce registry key to run whatever is 
    ##                    specified by the user.
    ##  REQUIREMENTS...:  Administrator credentials are needed to write to the 
    ##                    HKLM registry hive.
    ##  NOTES..........:  
    ##--------------------------------------------------------------------------
    Function Set-RunOnce {
        <#
        .SYNOPSIS
         Changes the RunOnce registry key to run whatever is specified by the 
         user.
        .DESCRIPTION
         This function writes subkeys to 'HKLM:\SOFTWARE\Microsoft\Windows\
         CurrentVersion\RunOnce'. 
         
         If run without parameters, this function will default RunOnce to run
         notepad.exe on the next reboot.
         
         By default anything written to this key will not run in Safe Mode, and 
         will not be run again if the operation fails.
        .PARAMETER Description
         This is the name of the subkey that will be written to RunOnce. This 
         can be any text, as long as there are no spaces in it.
         Alias..: -name, -n
        .PARAMETER FileToRun
         The full name (including path) of the file to run after reboot.
         Alias..: -file, -f
        .PARAMETER PassScriptToPowerShell
         In some instances it is necessary to specify the full path to the
         PowerShell executable when using PowerShell scripts with RunOnce. This
         Switch alters the FileToRun parameter to include this path.
         Alias..: -UsePoSh, -p
        .PARAMETER SafeMode
         This Switch will prepend a '*' character to the -FileToRun parameter,
         which will allow RunOnce to function in Safe Mode.
         Alias..: -safe, -s
        .PARAMETER Defer
         This Switch will prepend a '!' character to the -FileToRun parameter,
         which will delay the deletion of the RunOnce value until the command
         has completed. As a result, if a RunOnce operation does not run 
         properly, the associated program will be asked to run at the next boot.
         Alias..: -d
        .EXAMPLE
         C:\PS>Set-RunOnce
         
         This example will write a subkey to RunOnce named "Notepad" with a 
         REG_SZ value of 'notepad.exe', causing notepad.exe to run at the next 
         reboot.
         
        .EXAMPLE
         C:\PS>Set-RunOnce TestName c:\test.cmd
         
         This example will write a subkey to RunOnce named "TestName" with a 
         REG_SZ value of 'c:\test.cmd', causing test.cmd to run at the next 
         reboot.
         
        .EXAMPLE
         C:\PS>Set-RunOnce ps1 c:\a.ps1 -UsePoSh
         
         This example will write a subkey to RunOnce named "ps1" with a REG_SZ 
         value of 
         'C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe "c:\a.ps1"',
         causing PowerShell to run the a.ps1 script at the next reboot. 
         The use of the -PassScriptToPowerShell parameter (or it's aliases 
         -UsePoSh or -u) is not strictly necessary to get PowerShell scripts to 
         work with RunOnce, it will depend on how you have configured your 
         system to handle the execution of PowerShell scripts. When in doubt, 
         use this parameter to ensure that the script will run.
         
         NOTE:
         PowerShell's Execution Policy must be set to allow scripts to run for
         this to work.
        .EXAMPLE
         C:\PS>"c:\a.ps1" | Set-RunOnce ps1 -p
         
         This example does the same thing as EXAMPLE 3, but uses pipelining to
         pass the -FileToRun parameter, and uses the -p alias for the
         -PassScriptToPowerShell parameter.
         
        .NOTES
         NAME......:  Set-RunOnce
         AUTHOR....:  Joe Glessner
         LAST EDIT.:  10JUN11
         CREATED...:  11APR11
        .LINK
         https://joeit.wordpress.com/
        .LINK
         http://support.microsoft.com/kb/314866/EN-US
        .LINK
         http://msdn.microsoft.com/en-us/library/aa376977%28v=vs.85%29.aspx
        #>
        [CmdletBinding()]
        Param(
            [Parameter(ValueFromPipeline=$False,
                Position=0,
                Mandatory=$False)]
            [Alias("name","n")]
            [String]$Description="Notepad",
            [Parameter(ValueFromPipeline=$True,
                Position=1,
                Mandatory=$False)] 
            [Alias("file","f")]
            [String]$FileToRun="notepad.exe",
            [Alias("UsePosh","p")]
            [Switch]$PassScriptToPowerShell,
            [Alias("safe","s")]
            [Switch]$SafeMode,
            [Alias("d")]
            [Switch]$Defer
        )#END: Param
        Write-Verbose "Verifying user context..."
        $currentPrincipal = New-Object Security.Principal.WindowsPrincipal( `
        [Security.Principal.WindowsIdentity]::GetCurrent() ) 
        If ($currentPrincipal.IsInRole( `
            [Security.Principal.WindowsBuiltInRole]::Administrator )) { 
            Write-Verbose "PowerShell is running in Administrator context."
        }#END: If ($currentPrincipal.IsInRole(...
        Else { 
            Write-Warning "Set-RunOnce requires Administrator credentials."
            Write-Warning "Elevate PowerShell before retrying the operation."
            Write-Warning "No changes were made."
            Break
        }#END: Else 
        $RegistryKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce'
        $PoSh = "C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe"
        Write-Verbose "Marking current location..."
        Push-Location
        Write-Verbose "Moving to $RegistryKey..."
        Set-Location -Path $RegistryKey
        If($PassScriptToPowerShell) {
            $char0 = [char] '"'
            $char1 = [char] "'"
            $FullPath = $PoSh + " " + $char0 + $FileToRun + $char0
            Write-Verbose "Setting RunOnce to use PowerShell..."
            $FileToRun = $FullPath
        }#END: If($PassScriptToPowerShell)
        ElseIf($SafeMode) {
            $AltPath = "*" + $FileToRun
            Write-Verbose "Setting RunOnce to work in SafeMode..."
            $FileToRun = $AltPath
        }#END: ElseIf($SafeMode)
        If($Defer) {
            $AltPath = "!" + $FileToRun
            Write-Verbose "Setting to persist if $FileToRun fails to run ..."
            $FileToRun = $AltPath
        }#END: If($Defer)
        Write-Verbose "Creating RunOnce subkey for $Description..."
        Set-ItemProperty -Path . -Name $Description -Value $FileToRun
        Write-Verbose "Returning to marked location..."
        Pop-Location
    }#END: Function Set-RunOnce

 

PowerShell Function: Elevate-Process (like SUDO for PowerShell)

    ##--------------------------------------------------------------------------
    ##  FUNCTION.......:  Grant-ElevatedProcess
    ##  PURPOSE........:  Runs commands with an elevated security context when 
    ##                    UAC is enabled.
    ##  REQUIREMENTS...:  PowerShell v2
    ##  NOTES..........:  
    ##--------------------------------------------------------------------------
    Function Grant-ElevatedProcess {
        <#
        .SYNOPSIS
         Runs commands with an elevated security context when UAC is enabled.
        .DESCRIPTION
         Full description of function
        .PARAMETER Arguments
         The command to run elevated. Anything typed after the function name 
         will be processed.

        .EXAMPLE
         C:\PS>Grant-ElevatedProcess ipconfig /flushdns
         
         This will prompt for elevation, and then run a command that will clear 
         the DNS resolver cache on the local machine.
         
        .NOTES
         NAME......:  Grant-ElevatedProcess
         AUTHOR....:  Joe Glessner
         LAST EDIT.:  10FEB12
         CREATED...:  11APR11
         
         Based on code posted by weestro at http://weestro.blogspot.com/
        .LINK
         https://joeit.wordpress.com/
        .LINK
         http://weestro.blogspot.com/2009/08/sudo-for-powershell.html
        #>
        $File, [String]$Arguments = $Args;
        $Process = new-object System.Diagnostics.ProcessStartInfo $File;
        $Process.Arguments = $Arguments;
        $Process.Verb = "RunAs";
        $Process.WorkingDirectory = Get-Location;
        [System.Diagnostics.Process]::Start($Process);
    }#END: Function Grant-ElevatedProcess
    Set-Alias -name sudo -value Grant-ElevatedProcess

 

%d bloggers like this: