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.
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
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
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
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.
Thanks Glenn... once again, I haven't reach page 74 of the manual. My bad.