When executing Powershell from within PSExec or VBScript .exec method, powershell appears to hang.
In summary, Powershell doesn’t play nice with console applications.
From what I can gather it maintains a separate footprint for its console streams and therefore, any console based applications relying on STDOUT, STDERR, STDIN manipulation do not operate as expected.
To reproduce using PSExec.exe;
Test.ps1
Write-Output “HELLO”
Psexec –s c:\windows\system32\windowspowershell\v1.0\powershell.exe C:\Test.ps1
Hit CTRL-C and the script outputs “HELLO” as expected.
This suggests that the streams are only returned to the calling console when the script exits.
Blog Index
-
▼
2008
(40)
-
▼
April
(24)
- Access a Network Resource Alias using Computer Acc...
- ZTI DefaultDomainName setting lost
- ZTITattoo.wsf - OSD clears TaskSequence registry e...
- PowerShell appears to "hang" when executed from a ...
- Need to move the Microsoft Deployment Distribution...
- Fix Broken Windows Scripting Host
- Set Location in "Regional and Language Options" co...
- Dial up connections do not use LAN proxy settings
- Ever needed an Automated RunAs?
- LTI deployment fails with error "A connection to t...
- ZTI PreInstall phase fails with error 214700057
- ZTI Package update leaves .$M$ file(s)
- Error creating ZTI CD when using local SMS Console
- Various WMIC commands
- Various DSQUERY commands
- Using ImageX to compress a WIM file after modifica...
- When installing Windows XP on ESX you may receive ...
- VMWare Workstation - After WinPE deploy of sysprep...
- Pre-Stage Computer resource record in SMS
- Windows Path issues may prevent Group Policy from ...
- Hiding or Displaying Default Desktop icons
- ImportGPO.wsf may not import GPO's using a Migrati...
- Permissions for Moving a Computer Account
- Cached logons are available by default on a domain...
-
▼
April
(24)
Monday, April 28, 2008
PowerShell appears to "hang" when executed from a console application
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment