Hi,
In a loop I'm trying to concatenate two strings to be used as progressbar name to set (for each progressbar) the maximum value (from a counter):
My progressbar names are $progressbarDesktop, $progressbarFavorites, etc...
But it does not work... ERROR: Method invocation failed because [System.String] does not contain a method named 'Maximum'.
How can do in a loop ?
Thanks for your help ! (despite my bad english)
In a loop I'm trying to concatenate two strings to be used as progressbar name to set (for each progressbar) the maximum value (from a counter):
My progressbar names are $progressbarDesktop, $progressbarFavorites, etc...
Code:
$folders = @("Desktop", "Favorites", "Documents", "Pictures", "Music", "Downloads", "Videos")foreach ($Folder in $folders){$count= (Get-ChildItem -File -Path "C:\Users\John Doe\$folder" -recurse -attributes !H | Measure-Object).Count$progressbar = '$progressbar' + $folder$progressbar.Maximum = $count}
How can do in a loop ?
Thanks for your help ! (despite my bad english)
Statistics: Posted by BiocefBiocef — Wed Jun 12, 2024 5:06 am