Powershell Studio 2015 EXE Package Issue
Posted: Thu Jan 28, 2016 5:54 am
Product, version and build: Powershell Studio 2015
32 or 64 bit version of product: 64 bit
Operating system: Windows 10 Pro / Windows 8.1 Pro
32 or 64 bit OS: both 64 bit
When I write a basic Powershell script and I try to turn that into an exe file in Powershell Studio 2015, the exe runs, but instantly closes. I also have a control in my script that says to wait for a key press before closing the window. I am very interested in purchasing this product and the ability to create the exe packages is a big selling point for me and for my company. We would like to be able to create Powershell tools that standard uses can just double click on and get certain information (like password expiration dates and such). The script I was trying is below, if that matters. I just need to know if there is something I'm doing wrong in Powershell Studio 2015. If I create a form, I can make that an exe and it works as expected.
Get-Service | ? {$_.Status -eq "Running"}
# If running in the console, wait for input before closing.
if ($Host.Name -eq "ConsoleHost")
{
Write-Host "Press any key to continue..."
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null
}
Thanks in advance,
Steve B.
32 or 64 bit version of product: 64 bit
Operating system: Windows 10 Pro / Windows 8.1 Pro
32 or 64 bit OS: both 64 bit
When I write a basic Powershell script and I try to turn that into an exe file in Powershell Studio 2015, the exe runs, but instantly closes. I also have a control in my script that says to wait for a key press before closing the window. I am very interested in purchasing this product and the ability to create the exe packages is a big selling point for me and for my company. We would like to be able to create Powershell tools that standard uses can just double click on and get certain information (like password expiration dates and such). The script I was trying is below, if that matters. I just need to know if there is something I'm doing wrong in Powershell Studio 2015. If I create a form, I can make that an exe and it works as expected.
Get-Service | ? {$_.Status -eq "Running"}
# If running in the console, wait for input before closing.
if ($Host.Name -eq "ConsoleHost")
{
Write-Host "Press any key to continue..."
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null
}
Thanks in advance,
Steve B.