Status not displaye...
 
Notifications
Clear all

We appreciate the contributions many of you have been able to make towards repairing the storm damage and keeping a roof over our heads. With your help we’ve been able to complete much of the critical work. There is still work to be done to secure the house and your continued support will be a huge help.

Guests have read-only access to our forums. If you wish to participate you will need to register. Be sure to activate your account from the email sent to you when you register.

Status not displayed

5 Posts
2 Users
0 Reactions
1,131 Views
Tof0006
(@tof0006)
Eminent Member Registered
Joined: 2 years ago
Posts: 19
Topic starter   [#818]

Hi,

I don't understand my problem.
I've added this to my .ini file

# Firewall Profile
COMMENT=text: ,font-size:50%
SET-SECTION=key:fwstatus,value:fwprof.ps1
CMD=interval:120,text:Firewall Profile,trim:1,file:powershell.exe, \
	parameters:%fwstatus% \
	display: %fwstate%,code-page:437,no-wait:1

[fwprof.ps1]
try {
	$fwstate = Get-NetFirewallSetting -PolicyStore ActiveStore | Select-Object -ExpandProperty ActiveProfile

	Write-Host "$fwstate"
}
catch {
	Write-Host '<error>'
}

When I execute this manually, I get this result: Domain, Public
But on the display, I get the result in the picture.
What's wrong?
Thanks



   
Quote
Glenn
(@glenn)
Member Admin
Joined: 8 years ago
Posts: 2101
 

1. place a comma after "parameters:%fwstatus%

2. display should show %4

# Firewall Profile
COMMENT=text: ,font-size:50%
SET-SECTION=key:fwstatus,value:fwprof.ps1
CMD=interval:120, text:Firewall Profile, trim:1, file:powershell.exe, \
	parameters:%fwstatus%, \
	display: %4, code-page:437, no-wait:1


   
ReplyQuote
Tof0006
(@tof0006)
Eminent Member Registered
Joined: 2 years ago
Posts: 19
Topic starter  

Thanks, late answer because I was full this week.

I've tried and it's OK as always when you're answering.

Why putting %4 at the display value?
What is it related to?
Thanks



   
ReplyQuote
Glenn
(@glenn)
Member Admin
Joined: 8 years ago
Posts: 2101
 

When you refer to the CMD item in the manual on page 74 and 75, you'll see that %4 returns the STDOUT output text of the command you are executing.



   
ReplyQuote
Tof0006
(@tof0006)
Eminent Member Registered
Joined: 2 years ago
Posts: 19
Topic starter  

Thanks Glenn... once again, I haven't reach page 74 of the manual. My bad.



   
ReplyQuote
➤ Glenn's Page