This file contains hidden or 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
    
  
  
    
  | #Requires -RunAsAdministrator | |
| # Disables certificate CRL checking on Windows Server 2008 R2 | |
| # More info here: http://blogs.msdn.com/b/chaun/archive/2014/05/01/best-practices-for-crl-checking-on-sharepoint-servers.aspx | |
| $HKEYUSERS = get-childitem $(Resolve-Path Registry::HKEY_USERS\) | |
| foreach ($userKey in $HKEYUSERS) { | |
| $RegPath = $userKey.PSPath | |
| $RegPath = $RegPath + "\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing\" | |
| if ($(Test-Path $RegPath)) { | 
  
    
      This file contains hidden or 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
    
  
  
    
  | Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize | 
  
    
      This file contains hidden or 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
    
  
  
    
  | Get-WmiObject Win32_PnPSignedDriver | Select-Object DeviceName, DriverVersion | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #Requires -RunAsAdministrator | |
| # Disables IE WPAD on Windows Server 2008 R2 | |
| $HKEYUSERS = get-childitem $(Resolve-Path Registry::HKEY_USERS\) | |
| foreach ($userKey in $HKEYUSERS) { | |
| $RegPath = $userKey.PSPath | |
| $RegPath = $RegPath + "\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\" | |
| if ($(Test-Path $RegPath)) { | |
| $wpadSetting = (Get-ItemProperty -LiteralPath $RegPath).DefaultConnectionSettings | 
  
    
      This file contains hidden or 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
    
  
  
    
  | $msiPackageToInstall = "<path to .msi>" | |
| # save log from installation to temp file | |
| $tmpFile = [System.IO.Path]::GetTempFileName() | |
| Start-Process msiexec -ArgumentList "/i $msiPackageToInstall /qn /L*v $tmpFile" -NoNewWindow -Wait | 
  
    
      This file contains hidden or 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
    
  
  
    
  | Get-Command -All | Select-Object Name, CommandType, ModuleName, PSSnapIn, HelpUri | 
  
    
      This file contains hidden or 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
    
  
  
    
  | # Use the method .tostring("P"), for example: | |
| $a = [math]::PI | |
| $b = [math]::E | |
| ($a/$a).tostring("P") | 
  
    
      This file contains hidden or 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
    
  
  
    
  | function Get-LastBootTime { | |
| # returns last boot time and date as System.DateTime | |
| (Get-Date) - $([timespan]::FromMilliseconds([Environment]::TickCount ) ) | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | $dirSize = (Get-ChildItem -file -Recurse | Measure-Object length -sum).sum/1mb | |
| $dirSize = [math]::Round($dirSize) | |
| Write-Output "$(Get-Location): $dirSize Mb" |