I am new to PS and have a few scripts I have put together. I am running them sequentially from a batch file and all of the scripts use directory paths relative to the batch file. But, when I have data output to an xls file and attempt to saveas it goes directly into the my documents folder for that user.
I would like it to go into a folder relative to the batch file location.
the powershell script in the script folder will call on log files in the log folder using relative paths but when it comes to saving the xls it does not. Am I missing something here?
$a = New-Object -comobject Excel.Application
$a.visible = $True
$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)
$d = $c.UsedRange