When running the script on Windows 7 with the following command:
Update-Link.cmd "c:\users\admin\alias\command.lnk" light
The following error results:
The term '\Get-Link.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.
Adding a '.' to the path in Update-Link.ps1 fixes the issue temporarily:
$lnk = & ("$PSScriptRoot\Get-Link.ps1") $Path
$lnk = & ("$PSScriptRoot.\Get-Link.ps1") $Path
There is probably a better way of doing this or setting PSScriptRoot to '.'
When running the script on Windows 7 with the following command: Update-Link.cmd "c:\users\admin\alias\command.lnk" light
The following error results: The term '\Get-Link.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.
Adding a '.' to the path in Update-Link.ps1 fixes the issue temporarily: $lnk = & ("$PSScriptRoot\Get-Link.ps1") $Path $lnk = & ("$PSScriptRoot.\Get-Link.ps1") $Path
There is probably a better way of doing this or setting PSScriptRoot to '.'