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}