Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

replace not working

$
0
0

Does anyone know why the replace part of this doesn't work?




cd C:\archive\New folder
$oldtoplevel = 'c:\archive\'
#Archive directory
$newtoplevel = 'c:\scripts\'
$file = gci
$file.directoryname
$a = $file.directoryname
$a= $a.replace($newtoplevel, $oldtoplevel)
$a


Alter De Ruine



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>