Powershell path to config file from script

Discussion in 'Scripting' started by sebus, Mar 6, 2019.

  1. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,993
    1,825
    180
    I have a PS scipt that does have internal reference to an xml config

    $xmlFilePath = "Config_Device.xml"

    I need to execute it from System, so using NsudoC in a batch

    Code:
    %~dp0NSudoC.exe -U:S -P:E C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file %~dp0\somefile.ps1
    But running it I get error from PS that the Config_Device.xml cannot be found

    Any ideas?

    sebus
     
  2. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    8,823
    31,492
    270