PowerShell won’t rename an export .csv file
I am trying to rename the file export.csv to the $name but with a .csv extension instead of .file. The output is still $name.file. Import-Module ActiveDirectory $name = Read-Host “Enter Group Name” Get-ADGroupMember -identity “$name” -Recursive |select name, SamAccountName| export-csv -path C:\export.csv -NoTypeInformation get-childItem *.file | Rename-Item -newname {$name.name -replace ‘\.file’, ‘.csv’} So I did … Read more