You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you have an PowerProtect Data Manager automation question and PowerShell 7 is your language of choice?
Posting Guidelines
Be courteous
Be patient
Be specific
Post code samples
When posting in the Q&A forum please prefix your post with "PS7:" followed by your desired subject
Well formatted question
Q: This foreach loop only returns the number 5 and I need it return all 5 elements in the fixed length array $Retries $Retries = @(1..5) foreach($Retry in $Retries.count){ Write-Host $Retry } Result: 5
A: $Retries.count returns the total number of elements in the fixed length array, so a single response of 5 is the result. Removing the count property should get you the desired results.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Do you have an PowerProtect Data Manager automation question and PowerShell 7 is your language of choice?
Posting Guidelines
Well formatted question
Q: This foreach loop only returns the number 5 and I need it return all 5 elements in the fixed length array $Retries
$Retries = @(1..5) foreach($Retry in $Retries.count){ Write-Host $Retry } Result: 5
A: $Retries.count returns the total number of elements in the fixed length array, so a single response of 5 is the result. Removing the count property should get you the desired results.
$Retries = @(1..5) foreach($Retry in $Retries){ Write-Host $Retry } Result: 1 2 3 4 5
Beta Was this translation helpful? Give feedback.
All reactions