I have a script that creates an html file on the fly, and I want to be able to open it with IE upon completion.
I define the output file variable as: $out = "report.htm"
I want to specify a relative path on purpose as I will run this from a jump drive, so the file should be created next to my script on the jump drive.
And at the end of the script I use:
& "$env:programfiles\Internet Explorer\iexplore.exe" $out
The file gets created, but IE goes looking for a URL with the expanded name of my $out variable and fails.
If I hard code the value of $out in my script to be "C:\report.htm" then everything works.
The issue is, I never know the drive letter the system will assign my jump drive, and I do not want to write to the C drive, so want to try to use relative path names. Is there a way to accomplish this?
Thanks!