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 -version 4.0 | |
| Function Get-CimNamespace { | |
| [cmdletbinding(DefaultParameterSetName = 'computer')] | |
| Param( | |
| [Parameter(Position=0)] | |
| [ValidateNotNullorEmpty()] | |
| [string]$Namespace = "Root", | |
| [Parameter(ParameterSetName = 'computer')] | |
| [ValidateNotNullorEmpty()] | 
  
    
      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 -version 5.0 | |
| <# | |
| .SYNOPSIS | |
| Invoke any T-SQL query against any SQL supported database. | |
| .DESCRIPTION | |
| This command uses the .NET SqlClient classes to connect to a SQL database and execute any type of query. The default behavior is to use integrated Windows authentication, but you can pass a credential object for a username and password. This works well when run on Linux. | |
| When you run a SELECT query the command will write a custom object for each row to the pipeline. | |
| .PARAMETER Query | 
  
    
      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-PSWho { | |
| <# | |
| .SYNOPSIS | |
| Get PowerShell user summary information | |
| .DESCRIPTION | |
| This command will provide a summary of relevant information for the current | |
| user in a PowerShell session. You might use this to troubleshoot an end-user | |
| problem running a script or command. The default behavior is to write an | |
| object to the pipeline, but you can use the -AsString parameter to force the | 
  
    
      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 -version 5.0 | |
| #requires -module nettcpip,cimcmdlets | |
| <# | |
| This script will generate a WPF form to display network adapter | |
| information. It will automatically refresh every 30 seconds. | |
| You can change the interval then click the Update button. | |
| I don't recommend refreshing any faster than 10 seconds. It can take almost | |
| 5 seconds to get all the network adapter information. | 
  
    
      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 -version 4.0 | |
| #search WMI for a class | |
| Function Find-CimClass { | |
| [CmdletBinding()] | |
| [OutputType([Microsoft.Management.Infrastructure.CimClass])] | |
| Param( | |
| [Parameter(Position = 0, Mandatory, HelpMessage = "Enter the name of a CIM/WMI class. Wildcards are permitted.")] | |
| [ValidateNotNullOrEmpty()] | 
  
    
      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
    
  
  
    
  | #the folder size includes hidden files | |
| Function Get-FSOFolderSize { | |
| [cmdletbinding()] | |
| [OutputType("PSCustomObject")] | |
| param( | |
| [Parameter(Position = 0, Mandatory, HelpMessage = "Enter a filesystem path like C:\Scripts. Do not specify a directory root.")] | |
| [ValidateNotNullOrEmpty()] | 
  
    
      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 -version 3.0 | |
| Function New-HTMLDiskReport { | |
| <# | |
| .Synopsis | |
| Create a disk utilization report with gradient coloring | |
| .Description | |
| This command will create an HTML report depicting drive utilization through a gradient color bar. | 
  
    
      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-ProcessMemory { | |
| <# | |
| .SYNOPSIS | |
| Get a snapshot of a process' memory usage. | |
| .DESCRIPTION | |
| Get a snapshot of a process' memory usage based on its workingset value. You can get the same information using Get-Process or by querying the Win32_Process WMI class with Get-CimInstance. This command uses Invoke-Command to gather the information remotely. Many of the parameters are from that cmdlet. | |
| .EXAMPLE | |
| PS C:\> get-processmemory code,powershell* | 
  
    
      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-WindowsVersion { | |
| <# | |
| .SYNOPSIS | |
| Get Windows version information | |
| .DESCRIPTION | |
| This is a PowerShell version of the winver.exe utility. This commands uses PowerShell remoting to query the registry on a remote machine to retrieve Windows version information.The parameters are the same as in Invoke-Command. | |
| .PARAMETER Computername | |
| Specifies the computers on which the command runs. The default is the local computer. | 
  
    
      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-GitSize { | |
| <# | |
| .SYNOPSIS | |
| Get the size of .git folder | |
| .DESCRIPTION | |
| When using git, it creates a hidden folder for change tracking. Because the file is hidden it is easy to overlook how large it might become. This command provides a simple mechanism for calculating the size of the .git folder. Specify the parent folder path. | |
| .PARAMETER Path | |
| The path to the parent folder, not the .git folder. | 
NewerOlder