Odd behaviour of powershell script in K1000

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.


0 Comments   [ + ] Show comments

Answers (3)

Answer Summary:
Posted by: torstenspitz 1 year ago
Yellow Belt

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

Posted by: rileyz 1 year ago
Red Belt

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


Posted by: tpr 1 year ago
2nd Degree Black 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.

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