Windows Tray App No Output

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
RichMawdsley
Posts: 3
Last visit: Mon Jan 04, 2021 1:53 am

Windows Tray App No Output

Post by RichMawdsley »

Powershell Studio 5.5.154 64 bit
Windows 10 x64 v1703

Attempting to use the Windows Tray App feature, but regardless of what I try, nothing will output on screen.

I have tried my own simple script below, which should output something regardless every 10 seconds, and your example one here: https://www.sapien.com/blog/2017/07/10/ ... owershell/

The App simply runs in the system tray, but the Write-Host outputs never pop up.

Code: Select all

function LoadFile
{
$Global:File = Test-Path -Path C:\temp\test.txt	
}


$ProgressPreference = "SilentlyContinue"

while ($true)
{
	LoadFile
	if ($Global:file -eq $true)
	{
		Write-Host "Hello!"
	}
	Else
	{
		Write-Host ":("
	}
	Start-Sleep -Sec 10
}
Please help! Thanks, Rich.
User avatar
Olga_B
Site Admin
Posts: 196
Last visit: Mon Apr 15, 2024 12:32 pm

Re: Windows Tray App No Output

Post by Olga_B »

Hello,
I can't reproduce your issue. I created Tray app using your code. It works as expected.

Also it can be Windows issue. Try to re-start machine or re-logon
Attachments
test-blog-13048.png
test-blog-13048.png (195.92 KiB) Viewed 2563 times
User avatar
RichMawdsley
Posts: 3
Last visit: Mon Jan 04, 2021 1:53 am

Re: Windows Tray App No Output

Post by RichMawdsley »

Interesting! I just tried it on my home machine, and yes as you say it runs fine..

Which means it's something we've configured on work computers that's blocking it.. Tray notification / tool tips type things..

I'll dig in and post what I find!
User avatar
RichMawdsley
Posts: 3
Last visit: Mon Jan 04, 2021 1:53 am

Re: Windows Tray App No Output

Post by RichMawdsley »

Ok, found the culprit!

"Turn off all balloon notifications" - We have this set to Enabled. Which in turn seemingly stops Powershell Studio's implementation of Toast Notifications.. which is odd, because other apps can call toasts fine.

https://getadmx.com/?Category=Windows_1 ... ifications
User avatar
Olga_B
Site Admin
Posts: 196
Last visit: Mon Apr 15, 2024 12:32 pm

Re: Windows Tray App No Output

Post by Olga_B »

Glad to hear that you solved problem
This topic is 5 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.