Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

export to a csv and name the file the result of a variable

$
0
0

I want to export to a csv and name the file the result of the variable $xyz. The following does not work, but I'm close:

$xyz=get-contentj:\scripts\inventory\abc.txt

Export-CSV"J:\Scripts\Inventory\GeneralHW_"+$xyz+"DT.csv"-append

I get error: "Export-Csv : A positional parameter cannot be found that accepts argument 'blabla'."

'blabla' is the contents of abc.txt. Any suggestions?


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>