create a test file
new-item -type file -name test.txt
$filename="\home\sourav\test.txt"
$todaysdate=get-date -Format MMddyy
$file=Get-ChildItem $filename
$newfilename=$file.BaseName+"."+$todaysdat+$file.Extension
Rename-Item -path $filename -NewName $newfilename -verbose
new-item -type file -name test.txt
$filename="\home\sourav\test.txt"
$todaysdate=get-date -Format MMddyy
$file=Get-ChildItem $filename
$newfilename=$file.BaseName+"."+$todaysdat+$file.Extension
Rename-Item -path $filename -NewName $newfilename -verbose
No comments:
Post a Comment