I
I
Ivan2017-10-31 17:58:01
PowerShell
Ivan, 2017-10-31 17:58:01

How to upload csv to the folder where the script was launched from?

There is data on how to unload them along the path from where the script was launched.
$outstring | Export-csv -path ('ListScripts.csv') -f didn't help.
Maybe there is some system variable? When outputting an error, psh always determines where the script was run from.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
azarij, 2017-10-31
@Devagleo

dirty but works

$script_path = $MyInvocation.MyCommand.source -replace "\\$($myinvocation.MyCommand.Name)"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question