Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Output to a single file

$
0
0
I am sure that I am just putting something in the wrong spot. I have a script that checks multiple servers for their product key. I have been asked to do this by my boss but he wants it in a single file and I don't feel like cutting and pasting 145 times. What am I doing wrong?
Powershell
$computername=Get-Content"C:\PSScripts\Windows_PK_Check.txt"foreach($computerin$computername){Get-ProductKey-Computername$computer|Export-CSV"C:\PSScripts\ProductKeys\Windows\$computer.csv"-NoTypeInformation}


Viewing all articles
Browse latest Browse all 15370

Trending Articles



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