Export-Csv Incorrect function.
Posted: Sun Dec 01, 2019 10:44 pm
Hello,
when i run the function below in Studio i get: Incorrect function.
here is an example of the csv file:
ComputerName,MAC,IP,Date
"PC-01-01","74-D4-25-B3-77-7A","10.0.0.1","02/12/2019"
"PC-00-00","74-D4-25-B3-77-7B","10.0.0.2","02/12/2019"
"PC-11-01","74-D4-25-B3-77-7C","10.0.0.3","02/12/2019"
"PC-01-11","74-D4-25-B3-77-7D","10.0.0.4","02/12/2019"
it works in ISE...
Any help would be great
Thanks,
Sean
when i run the function below in Studio i get: Incorrect function.
- function retention-file ($file)
- {
- $currentfile = import-csv -Path $file
- $currentfile | Select-Object -Last 3 | Export-Csv -Path $file -Force -Confirm:$false -NoTypeInformation
- }
ComputerName,MAC,IP,Date
"PC-01-01","74-D4-25-B3-77-7A","10.0.0.1","02/12/2019"
"PC-00-00","74-D4-25-B3-77-7B","10.0.0.2","02/12/2019"
"PC-11-01","74-D4-25-B3-77-7C","10.0.0.3","02/12/2019"
"PC-01-11","74-D4-25-B3-77-7D","10.0.0.4","02/12/2019"
it works in ISE...
Any help would be great
Thanks,
Sean