How to run retry the commands multiple times in TRY block
问题 Here in below code in try block I want to retry the last three commands to run multiple times and then proceed with catch and finally block. Means a kind of retries if we can put for this 5th, 6th, and 7th line. Lets say 5th line should run 3 times and if it fails then proceed with catch and finally . try { $hostcomputer = hostname $IP = "10.x.x.x" $pso = New-PSSessionOption -SkipCACheck -SkipRevocationCheck -SkipCNCheck:$TRUE -ErrorAction Stop $session = New-PSSession -Authentication