@@ -98,53 +98,53 @@ public Tuple<string, bool> GetOldVersion()
98
98
version = localVersion ;
99
99
isPreview = localPreview ;
100
100
101
- using ( PowerShell powetshell = PowerShell . Create ( ) )
102
- {
103
- powetshell . AddScript ( "Register-PackageSource -Name PSGallery -Location https://www.powershellgallery.com/api/v2 -ProviderName PowerShellGet" ) ;
104
- powetshell . AddScript ( "Find-Module -Name " + moduleName + " -AllowPrerelease -Repository PSGallery -AllVersions" ) ;
105
- var cmdletResult = powetshell . Invoke ( ) ;
106
- if ( cmdletResult . Count != 0 )
107
- {
108
- var psVersionImformation = cmdletResult [ 0 ] . ToString ( ) ;
109
- Regex reg = new Regex ( "Version=(.*?)(-|;)" ) ;
110
- Match match = reg . Match ( psVersionImformation ) ;
111
- psVersion = match . Groups [ 1 ] . Value ;
112
- psPreview = Regex . IsMatch ( psVersionImformation , "preview" ) ;
113
- }
114
- }
115
- if ( psVersion == null )
116
- {
117
- psVersion = "0.1.0" ;
118
- }
119
- if ( new AzurePSVersion ( psVersion ) > new AzurePSVersion ( version ) )
120
- {
121
- version = psVersion ;
122
- isPreview = psPreview ;
123
- }
124
-
125
- using ( PowerShell powetshell = PowerShell . Create ( ) )
126
- {
127
- powetshell . AddScript ( "Register-PackageSource -Name TestGallery -Location https://www.poshtestgallery.com/api/v2 -ProviderName PowerShellGet" ) ;
128
- powetshell . AddScript ( "Find-Module -Name " + moduleName + " -AllowPrerelease -Repository TestGallery -AllVersions" ) ;
129
- var cmdletResult = powetshell . Invoke ( ) ;
130
- if ( cmdletResult . Count != 0 )
131
- {
132
- var testVersionImformation = cmdletResult [ 0 ] . ToString ( ) ;
133
- Regex reg = new Regex ( "Version=(.*?)(-|;)" ) ;
134
- Match match = reg . Match ( testVersionImformation ) ;
135
- testVersion = match . Groups [ 1 ] . Value ;
136
- testPreview = Regex . IsMatch ( testVersionImformation , "preview" ) ;
137
- }
138
- }
139
- if ( testVersion == null )
140
- {
141
- testVersion = "0.1.0" ;
142
- }
143
- if ( new AzurePSVersion ( testVersion ) > new AzurePSVersion ( version ) )
144
- {
145
- version = testVersion ;
146
- isPreview = testPreview ;
147
- }
101
+ // using (PowerShell powetshell = PowerShell.Create())
102
+ // {
103
+ // powetshell.AddScript("Register-PackageSource -Name PSGallery -Location https://www.powershellgallery.com/api/v2 -ProviderName PowerShellGet");
104
+ // powetshell.AddScript("Find-Module -Name " + moduleName + " -AllowPrerelease -Repository PSGallery -AllVersions");
105
+ // var cmdletResult = powetshell.Invoke();
106
+ // if (cmdletResult.Count != 0)
107
+ // {
108
+ // var psVersionImformation = cmdletResult[0].ToString();
109
+ // Regex reg = new Regex("Version=(.*?)(-|;)");
110
+ // Match match = reg.Match(psVersionImformation);
111
+ // psVersion = match.Groups[1].Value;
112
+ // psPreview = Regex.IsMatch(psVersionImformation, "preview");
113
+ // }
114
+ // }
115
+ // if (psVersion == null)
116
+ // {
117
+ // psVersion = "0.1.0";
118
+ // }
119
+ // if (new AzurePSVersion(psVersion) > new AzurePSVersion(version))
120
+ // {
121
+ // version = psVersion;
122
+ // isPreview = psPreview;
123
+ // }
124
+
125
+ // using (PowerShell powetshell = PowerShell.Create())
126
+ // {
127
+ // powetshell.AddScript("Register-PackageSource -Name TestGallery -Location https://www.poshtestgallery.com/api/v2 -ProviderName PowerShellGet");
128
+ // powetshell.AddScript("Find-Module -Name " + moduleName + " -AllowPrerelease -Repository TestGallery -AllVersions");
129
+ // var cmdletResult = powetshell.Invoke();
130
+ // if (cmdletResult.Count != 0)
131
+ // {
132
+ // var testVersionImformation = cmdletResult[0].ToString();
133
+ // Regex reg = new Regex("Version=(.*?)(-|;)");
134
+ // Match match = reg.Match(testVersionImformation);
135
+ // testVersion = match.Groups[1].Value;
136
+ // testPreview = Regex.IsMatch(testVersionImformation, "preview");
137
+ // }
138
+ // }
139
+ // if (testVersion == null)
140
+ // {
141
+ // testVersion = "0.1.0";
142
+ // }
143
+ // if (new AzurePSVersion(testVersion) > new AzurePSVersion(version))
144
+ // {
145
+ // version = testVersion;
146
+ // isPreview = testPreview;
147
+ // }
148
148
149
149
return Tuple . Create ( version , isPreview ) ;
150
150
}
0 commit comments