-
Notifications
You must be signed in to change notification settings - Fork 1
Read PSScript
This cmdlet shows the specified script by adding line numbers and error occurred lines as per the parameters specified. This cmdlet has three parameter sets and parameter '-Script' is the only Mandatory parameter.This functionality will be handy in case of Administration using console only option to analyze error occurring areas of a script.
PS C:\> Read-PSScript -Script .\test.ps1
Reads the script and output script as plaintext including line numbers.
PS C:\> Read-PSScript -Script .\test.ps1 -HighlightLine (1..5).
Reads and outputs the script by highlighting first five lines.
PS C:\> Read-PSScript -Script .\test.ps1 -ExecuteAndShowBadLineAs Raw
Executes the script as usual and shows the script as text after script execution by highlighting error caused lines.
PS C:\> Read-PSScript -Script .\test.ps1 -ExecuteAndShowBadLineAs TextTable
Executes script as usual and shows the Script output,Errors and Error occured line,Expression,Exception and Message as plain text Table.
PS C:\> Read-PSScript -Script .\test.ps1 -ExecuteAndShowBadLineAs TextTable -HideError
Execute script as usual and shows the Script output and error details as plain text table by hiding Error occured.
PS C:\> Read-PSScript -Script .\test.ps1 -ExecuteAndShowBadLineAs TextTable -HideError -HideOutput
Execures the script as ususal and shows only the error details as plaint text table by hiding script output and error occurred.