Sorry I am new to PowerShell and learning as I go. I want to use the get-content, and get-printer to output the name of a pc and all printers attached then write the information to a txt file. However I will be pushing this out in sccm so I want the script not to overwrite any previous entries or make copies. The script would write new lines to a txt file listing pc names and attached printers. Ideally I want to push out the script overnight and hopefully in the morning I have a nice txt file with my network PC names and connected printers all in one txt file. Bellow is what i have came up so far but obviously not working or doing what i would like it to do.
$computer = gc env:computernameGet-content env:computername
Get-Printer
Get-Printer | Get-Content | Out-File \\network path of .txt file location
Technology should not be a problem but a solution.