Show-Inspector

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

Syntax

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

Parameters

Type

Name

Description

Optional

String

Highlight

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

yes

../../_images/variableinspector.png

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.

 1function Get-Path{
 2param($switch)
 3switch($switch){
 4        a{$path = "C:\Temp\a.txt";break}
 5        b{$path = "C:\Temp\b.txt";break}
 6        c{$path = "C:\Temp\.txt";break}
 7        d{$path = "C:\Temp\d.txt";break}
 8}
 9return $path
10
11} $path = Get-Path -switch 'c'
12
13Show-Inspector "path"
14Get-Content $path