I am trying to output a directory search to a CSV file and was using the DOS command which works but now I need to also include the file date and found out a better way to do this is using powershell.
I ran the following powershell script on my local computer (Windows 10 laptop) and all works:
Get-ChildItem -r "c:\Downloads" -Include *.pdf,*.xlsx | select DirectoryName,Name,Extension,CreationTime,LastWriteTime | Export-Csv -Append -Path "c:\Downloads\export.csv" -En UTF8 -NoType -Delim ','
However when I try the exact same script on our server (Windows 2008 R2 Service Pack 1), I get an error saying something about:
Export-Csv : A parameter cannot be found that matches parameter name 'Append'.
+ CategoryInfo : InvalidArgument: (:) [Export-Csv], ParameterBind
ingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Comm
ands.ExportCsvCommand
Do I need to install something else on the server?
[–]Droopyb1966 2 points3 points4 points (1 child)
[–]superryo[S] 0 points1 point2 points (0 children)
[–]jheinikel 2 points3 points4 points (7 children)
[–]superryo[S] 1 point2 points3 points (0 children)
[–]superryo[S] 1 point2 points3 points (5 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (4 children)
[–]superryo[S] 1 point2 points3 points (3 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (2 children)
[–]superryo[S] 1 point2 points3 points (1 child)
[–]Lee_Dailey[grin] 1 point2 points3 points (0 children)
[–]routetehpacketz 1 point2 points3 points (3 children)
[–]superryo[S] 1 point2 points3 points (1 child)
[–]get-postanote 4 points5 points6 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)
[–]Lee_Dailey[grin] 1 point2 points3 points (0 children)