I have a list of directories with numbers. I have to find the highest number and and increment it by 1 and create a new directory with that increment value. I am able to sor
Use:
$filelist = @("11", "1", "2") $filelist | sort @{expression={[int]$_}} | % {$newName = [string]([int]$_ + 1)} New-Item $newName -ItemType Directory