I am using the following script to import a computer list and remove specific desktop icons:
Get-Content C:\Data\PS\Imports\24.csv |
ForEach-Object{
Get-Item "\\$($_.Name)\c$\users\Public\Desktop\Series *.lnk" -EA 0 |
Remove-Item}
I would like to log the success and failures. I have used the following 3 methods, none of which are working for me. Redirect and Transcript create blank files, while export creates nothing.
> "C:\Output.txt"
Start-Transcript -Path "C:\Output.txt" -Append
| Export-csv -Path "C:\Output.csv"