@@ -870,40 +870,7 @@ public virtual bool IsTerminatingError(Exception ex)
870870
871871 protected string LoadAzVersion ( )
872872 {
873- Version latestAz = new Version ( "0.0.0" ) ;
874- string latestSuffix = "" ;
875- using ( var powershell = System . Management . Automation . PowerShell . Create ( ) )
876- {
877- powershell . Runspace = RunspaceFactory . CreateRunspace ( this . Host ) ;
878- powershell . AddCommand ( "Get-Module" ) ;
879- powershell . AddParameter ( "Name" , "Az" ) ;
880- powershell . AddParameter ( "ListAvailable" , true ) ;
881- powershell . Runspace . Open ( ) ;
882- Collection < PSObject > outputs = powershell . Invoke ( ) ;
883- foreach ( PSObject obj in outputs )
884- {
885- string psVersion = obj . Properties [ "Version" ] . Value . ToString ( ) ;
886- int pos = psVersion . IndexOf ( '-' ) ;
887- string currentSuffix = ( pos == - 1 || pos == psVersion . Length - 1 ) ? "" : psVersion . Substring ( pos + 1 ) ;
888- Version currentAz = ( pos == - 1 ) ? new Version ( psVersion ) : new Version ( psVersion . Substring ( 0 , pos ) ) ;
889- if ( currentAz > latestAz )
890- {
891- latestAz = currentAz ;
892- latestSuffix = currentSuffix ;
893- }
894- else if ( currentAz == latestAz )
895- {
896- latestSuffix = String . Compare ( latestSuffix , currentSuffix ) > 0 ? latestSuffix : currentSuffix ;
897- }
898- }
899- }
900- string ret = latestAz . ToString ( ) ;
901- if ( ! String . IsNullOrEmpty ( latestSuffix ) )
902- {
903- ret += "-" + latestSuffix ;
904- }
905- WriteDebug ( string . Format ( "Sought all Az modules and got latest version {0}" , ret ) ) ;
906- return ret ;
873+ return "1.0.0" ;
907874 }
908875 }
909876}
0 commit comments