Skip to content

Commit 00c0281

Browse files
committed
Comment out the logic of get gallery version.
1 parent 320f759 commit 00c0281

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

tools/VersionController/Models/VersionBumper.cs

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -98,53 +98,53 @@ public Tuple<string, bool> GetOldVersion()
9898
version = localVersion;
9999
isPreview = localPreview;
100100

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+
// }
148148

149149
return Tuple.Create(version, isPreview);
150150
}

0 commit comments

Comments
 (0)