Show-Inspector

Opens the inspector window.
The inspector is a debugging tool which shows all existing variables and their values:

../../_images/variableinspector.png

Syntax

Show-Inspector [-Highlight <String>] [<CommonParameters>]

Parameters

Type

Name

Description

Optional

String

Highlight

The inspector jumps to the passed variable. E.g. ‘$file’

yes

Return type

empty

Example

Admittedly the error in the example is obvious, but it’s just intented to show a possible purpose of the inspector.
In a more complex script you can easily check your variables with this method without writing them out to a textfile.

function Get-Path{
  param($switch)
   switch($switch){
	 a{$path = "C:\Temp\a.txt";break}
	 b{$path = "C:\Temp\b.txt";break}
	 c{$path = "C:\Temp\.txt";break}
	 d{$path = "C:\Temp\d.txt";break}
   }
  return $path
}

$path = Get-Path -switch 'c'
Show-Inspector "path"
Get-Content $path