Forum Discussion

Rambo363636's avatar
Rambo363636
Brass Contributor
Jun 26, 2024

Below Powershell script is not working without running as administrator.

Hi All, I want to change the default font to Verdana on excel to all users on the intune endpoints. But script is not working for some users. When checked directly on powershell i get the below err...
  • Thihan_Lin's avatar
    Thihan_Lin
    Jun 27, 2024

    Hi Rambo363636 

     

    I understand that pain. I assume that is an issue with the 32 and 64-bit versions.

    Could you please put the script code below at the beginning of your script and try to push it again?

     

    If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") {

        Try {

            &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH

        }

        Catch {

            Throw "Failed to start $PSCOMMANDPATH"

        }

        Exit

    }

     

    Please mark it as resolved if this is the solution for you.

    Thank you.

    Thihan

Resources