I have a power shell script which has include script in it as below.
. "$PSScriptRoot\CheckPermissions.ps1"
When the script is invoked from c#, I am getting this error
{The term '\CheckPermissions.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.}
The script works fine when run from PS window.
Is not $PSScriptRoot variable available when script is run from c#?