Skip to content

Latest commit

 

History

History

v3-Interactive-issues

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

v3 interactive issues

In PowerShell 3.0 several interactive features have issues. These features work as expected in PowerShell 2.0 and most of them in 4.0.

Note that .test.ps1 covers only tests that do not require user interaction. Most of test scripts here are interactive and supposed to be invoked manually, in v3 in order to see issues, in v2 and v4 in order to see it all working fine.

$Host.EnterNestedPrompt() is ignored (v3)

If a script with $Host.EnterNestedPrompt() is invoked with PowerShell.exe without the switch NoExit then the nested prompt is not entered, invocation continues.

The workaround is use of the switch NoExit.

Write-Debug prompt - "Suspend" is ignored (v3)

When the debug preference ($DebugPreference) is set to Inquire then Write-Debug shows a debug message and the prompt with several options. One of the options Suspend is supposed to enter the nested prompt. It is ignored in v3 if PowerShell.exe is invoked without NoExit.

The workaround is use of the switch NoExit.

"exit" in Command is ignored if NoExit is specified (v3, v4)

This is not exactly an interactive issue but it is somehow related to problems of PowerShell 3.0 described here. The following perhaps unusual CMD command

PowerShell.exe -NoExit . "'<path>\Script.ps1'"; exit

has useful applications described in details in this blog post. In PowerShell 3.0 and 4.0 it is not working as designed because exit is ignored and PowerShell is not exiting.