I'm trying to redirect console output from a TFS command to a file with the following command:
witadmin listfields /collection:blahblah:8080/tfs/TPC > TFSfields.txt
but I get an error:
"Access to the path 'C:\....\TFSfields.txt is denied"
and also further down:
OpenError: (:) [Out-File], UnauthorizedAccess
I'm fairly new to PowerShell, so I'm not sure how I could not have access to create a file in a directory on my own machine. I'm assuming I'm missing something simple. When I run the command without redirecting output, it outputs what I expect to the screen.
witadmin listfields /collection:blahblah:8080/tfs/TPC > "$env:USERPROFILE\Desktop\TFSfields.txt"
That will create the file on the current user's desktop. - TheMadTechnician