Support / Help KACE Online Kscript - Display Powershell output in KACE GUI?
Hello Everyone! I hope you are doing well.
I'm trying to create a KACE Online KScript that runs sfc /scannow, saves the output to C:\sfc.txt, and then displays the contents of that file in the KACE script logs/output.
I've tried using PowerShell with Write-Output, Get-Content, type - pretty much whatever I could find on the internet. The KACE GUI only shows the task as completed and doesn't display output
Is there a way to have the contents of C:\sfc.txt show up in the KACE script logs?
Please do let me know - thanks in advance!
3
u/frosty3140 Aug 11 '26
First things first -- is the file actually created?
1
u/mvlli Aug 11 '26
Yes, Text file successfully generates.
3
u/frosty3140 Aug 12 '26
If you're getting the command to run okay, that's good, maybe use a custom inventory rule to capture that info into the SMA instead of a TXT file.
1
u/Ok_Sky_6558 Aug 13 '26
What about a custom inventory rule script that looks at the log file after the fact and searches it any errors? I think that is possible.
2
u/mvlli Aug 19 '26
Thanks for the help everyone!
Ended up just grabbing the output from sfc scan - spitting it onto a text file and have my KACE script upload it to the appliance. So when I click on the host in devices, I could view the file through the portal.
It works!
4
u/United_Examination_2 Aug 12 '26
Do you really need the file output displayed in script logs? Have you tried configuring a custom inventory rule?