KACE Product Support Question

Odd behaviour of powershell script in K1000

09/04/2020 221 views

I have an online kscript to check whether the boot loader is uefi or legacy bios. It creates a text file in a shared folder named for the pc and the result - bios or uefi. When I run the script manually, it works properly - my computer has uefi in the name. When I run it in kbox, all computers have bios in the name, including mine. I've tried running as system and with a saved admin credential (same one I used for the manual run), but still get bios for all.

Here's the script.

#Detect Legacy BIOS or UEFI

$BL = bcdedit |findstr winload.efi

if (Test-Path "\\FS1\Logins\Computers\BootLoader\*$PC.txt")
if ($BL -ne $null)
{$PC | Out-File "\\FS1\BootLoader\uefi-$PC.txt" -append}


{$PC| Out-File "\\FS1\BootLoader\bios-$PC.txt" -append}

I appreciate any insights. If this is already in inventory somewhere and someone can point me to it, that would be great, too.


Answer Summary:
0 Comments   [ + ] Show comments


Answer Chosen by the Author


Most likely this is because of the KACE Agent running in 32 bit.

Try starting the script with cd c:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe

Answered 09/05/2020 by: torstenspitz
Yellow Belt

All Answers


Could try this function, since your method is borking in KACE.


Answered 09/07/2020 by: rileyz
Red Belt


The sysnative path fixed it. I ran into that 8 or 10 months ago, so I need to tattoo on my forehead.

Thanks to both of you for the responses.

Answered 09/08/2020 by: tpr
2nd Degree Black Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ