Hello,
I am working on a Windows form using PowerShell. I need to generate a file from the form application and place the file in the script's executable path. I have the function below which I use for getting the script path in a command console mode, but it does not return any value when I launch it in the Windows form.
function get-ScriptPath {
if($MyInvocation.ScriptName)
{$scriptPath = $MyInvocation.ScriptName}
else
{$scriptPath = $MyInvocation.MyCommand.Definition}
Split-Path -Parent $scriptPath
}
I want to know if there is any way I can do to get the Windows form's executable path.
Thank you in advance.
I am working on a Windows form using PowerShell. I need to generate a file from the form application and place the file in the script's executable path. I have the function below which I use for getting the script path in a command console mode, but it does not return any value when I launch it in the Windows form.
function get-ScriptPath {
if($MyInvocation.ScriptName)
{$scriptPath = $MyInvocation.ScriptName}
else
{$scriptPath = $MyInvocation.MyCommand.Definition}
Split-Path -Parent $scriptPath
}
I want to know if there is any way I can do to get the Windows form's executable path.
Thank you in advance.