WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: spl on July 28, 2026, 10:18:26 AM

Title: Final Std_Out Powershell teaser
Post by: spl on July 28, 2026, 10:18:26 AM
The attached .wbt script is as simple as it gets to (1) determine PS is installed via Registry query (2) and if installed output available modules in gridview.

And, for the curious, the Powershell Gallery is the main repository of some pretty incredible modules. Put this sample into the previous code I posted to see what can be installed

;sample 5
q = '*WMI*'  ; or try '*Excel*'  or '*SQL*'
args = "Find-Module {q} | Select Name, Version, Author, ProjectUri, Description | Out-Gridview -Title 'Searching for {q} Modules' -PassThru"
args = StrReplace(args,'{q}',q)
Title: Re: Final Std_Out Powershell teaser
Post by: td on July 29, 2026, 07:27:51 AM
I tried the above, but it ran for so long that the OS decided the process had hung. Being an impatient soul, I eventually just killed it.
Title: Re: Final Std_Out Powershell teaser
Post by: spl on July 29, 2026, 09:46:44 AM
Quote from: td on July 29, 2026, 07:27:51 AMI tried the above, but it ran for so long that the OS decided the process had hung. Being an impatient soul, I eventually just killed it.

I had Jim test it before I uploaded. I have over 300 modules installed, and it took a long time for me to get a GUI gridview. But it was meant to terminate immediately if reg entry was not there. Besides, most of the stuff could just be run from commandline. Sorry, you had an issue --- maybe a problem with Winbatch
Title: Re: Final Std_Out Powershell teaser
Post by: JTaylor on July 29, 2026, 10:12:12 AM
It took about 10 seconds to display for me but I only had about 75+- modules.

Jim
Title: Re: Final Std_Out Powershell teaser
Post by: spl on July 30, 2026, 05:38:09 AM
Quote from: JTaylor on July 29, 2026, 10:12:12 AMIt took about 10 seconds to display for me but I only had about 75+- modules.

Jim

Thanks Jim. I put these STD_Out scripts together in about 90 seconds. This latest one would be for those that didn't play with PS or realize it was even installed --- so I figured they would have minimal modules installed. One can move the BoxShut() in the udf to the end of the main script to keep that window alive, and you can mess with the timeout parameter in the udf. No harm, no foul -- like I wrote 'just trying to keep the conversation lively'
Title: Re: Final Std_Out Powershell teaser
Post by: td on August 03, 2026, 07:26:09 AM
Quote from: spl on July 29, 2026, 09:46:44 AM
Quote from: td on July 29, 2026, 07:27:51 AMI tried the above, but it ran for so long that the OS decided the process had hung. Being an impatient soul, I eventually just killed it.

I had Jim test it before I uploaded. I have over 300 modules installed, and it took a long time for me to get a GUI gridview. But it was meant to terminate immediately if reg entry was not there. Besides, most of the stuff could just be run from commandline. Sorry, you had an issue --- maybe a problem with Winbatch

No, it is not a problem with WinBatch and it is not a big deal. I just thought I should mention it.
Title: Re: Final Std_Out Powershell teaser
Post by: td on August 03, 2026, 08:37:01 AM
I did discovered the source of the problem, however. It appears I had an out-of-date "provider assembly" and PS was prompting for permission to update it, which I could not view by running your script.

[edit]
I suspect a minor modification or two to your Get_stdout() script would allow any erstwhile user to at least be made aware of this or similar issues.
Title: Re: Final Std_Out Powershell teaser
Post by: spl on August 04, 2026, 07:14:12 AM
Quote from: td on August 03, 2026, 08:37:01 AMI suspect a minor modification or two to your Get_stdout() script would allow any erstwhile user to at least be made aware of this or similar issues.

Maybe yes; maybe no. I have developed a multi-parameter Std_Out, compiled as a WB exe as a general detection of PS on a PC/Laptop. Abandoned that, as PS 7 has the stage now. PS 5.1 comes with win10/11 so I assumed most of my simple or one-liner scripts would work. But in the back of my mind was the fact that users on this forum would not generally give a [] so those early Std_Out scripts were never deployed here as internally developed.
Title: Re: Final Std_Out Powershell teaser
Post by: td on August 05, 2026, 07:43:15 AM
Whatever.