Commits

mgnandt committed 232f6c6

Reduced code to find last index of slashes

Comments (0)

Files changed (1)

Microsoft.SqlServer.Management.PowerShell.sqlps_profile.ps1

     TabExpansionSqlPsBackup $line $lastWord
   }
   else {
-    $aindex = $lastWord.LastIndexOf('\')
-    $bindex = $lastWord.LastIndexOf('/')
-    $index = (($aindex, $bindex) | measure-object -max).Maximum
+    $index = $lastWord.LastIndexOfAny(@('\', '/'))
     if ($index -gt -1) { 
       $parent = $lastWord.substring(0, $index+1) 
       $leaf = $lastWord.substring($index+1)