PowerShell Script -Config parameter

Hello. I wanted to know if anyone has gotten the -Config parameter to work within an action script.
The following works with no problem but I want to call a config file for a specific reason

waithidden { pathname of file ((it as string) of value “Path” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell” of native registry) } -ExecutionPolicy Bypass -File “C:\Users\xxxx\Desktop\ToastNotificationScript2.1.0\New-ToastNotification.ps1”

Does not work
waithidden { pathname of file ((it as string) of value “Path” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell” of native registry) } -ExecutionPolicy Bypass -File “C:\Users\xxxx\Desktop\ToastNotificationScript2.1.0\New-ToastNotification.ps1” -Config .\config-toast-adpwexpiration.xml

Your script implies that the configuration file will v in the current folder, but where do you think that would be?

I think you should try using a fully qualified path

3 Likes