Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/Modules/Shared/PowerShellGet/PSModule.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ function Publish-Module
return
}
}
elseif(-not $modulePathWithVersion -and ($PSVersionTable.PSVersion -ge [Version]'5.0'))
elseif(-not $modulePathWithVersion -and ($PSVersionTable.PSVersion -ge '5.0.0'))
{
$module = Microsoft.PowerShell.Core\Get-Module -Name $resolvedPath -ListAvailable -ErrorAction SilentlyContinue -Verbose:$false
}
Expand Down Expand Up @@ -1783,7 +1783,7 @@ function Install-Module
if(-not($YesToAll -or $NoToAll -or $SourceSGrantedTrust.Contains($source) -or $sourcesDeniedTrust.Contains($source) -or $Force))
{
$message = $QueryInstallUntrustedPackage -f ($psgetModuleInfo.Name, $psgetModuleInfo.RepositorySourceLocation)
if($PSVersionTable.PSVersion -ge [Version]"5.0")
if($PSVersionTable.PSVersion -ge '5.0.0')
{
$sourceTrusted = $psCmdlet.ShouldContinue("$message", "$RepositoryIsNotTrusted",$true, [ref]$YesToAll, [ref]$NoToAll)
}
Expand Down Expand Up @@ -3509,7 +3509,7 @@ function Install-Script
{
$message = $QueryInstallUntrustedPackage -f ($psRepositoryItemInfo.Name, $psRepositoryItemInfo.RepositorySourceLocation)

if($PSVersionTable.PSVersion -ge [Version]"5.0")
if($PSVersionTable.PSVersion -ge '5.0.0')
{
$sourceTrusted = $psCmdlet.ShouldContinue("$message", "$RepositoryIsNotTrusted",$true, [ref]$YesToAll, [ref]$NoToAll)
}
Expand Down Expand Up @@ -5580,7 +5580,7 @@ function Get-RequiresString
$RequiredModuleStrings += "@{$($keyvalueStrings -join '; ')}"
}
}
elseif(($PSVersionTable.PSVersion -eq [Version]'3.0') -and
elseif(($PSVersionTable.PSVersion -eq '3.0.0') -and
($requiredModuleObject.GetType().ToString() -eq 'Microsoft.PowerShell.Commands.ModuleSpecification'))
{
# ModuleSpecification.ToString() is not implemented on PowerShell 3.0.
Expand Down Expand Up @@ -10374,7 +10374,7 @@ function Install-PackageUtility
if( (-not $MinimumVersion -and ($version -ne $InstalledModuleInfo.Version)) -or
($MinimumVersion -and ($MinimumVersion -gt $InstalledModuleInfo.Version)))
{
if($PSVersionTable.PSVersion -ge [Version]"5.0")
if($PSVersionTable.PSVersion -ge '5.0.0')
{
$message = $LocalizedData.ModuleAlreadyInstalledSxS -f ($InstalledModuleInfo.Version, $InstalledModuleInfo.Name, $InstalledModuleInfo.ModuleBase, $version, $InstalledModuleInfo.Version, $version)
}
Expand Down Expand Up @@ -12234,7 +12234,7 @@ function Test-ModuleSxSVersionSupport
{
# Side-by-Side module version is avialable on PowerShell 5.0 or later versions only
# By default, PowerShell module versions will be installed/updated Side-by-Side.
$PSVersionTable.PSVersion -ge [Version]"5.0"
$PSVersionTable.PSVersion -ge '5.0.0'
}

function Test-ModuleInstalled
Expand Down Expand Up @@ -13008,8 +13008,8 @@ function Update-ModuleManifest
{
#DscResourcesToExport field is not available in PowerShell version lower than 5.0

if (($PSVersionTable.PSVersion -lt [Version]"5.0") -or ($PowerShellVersion -and $PowerShellVersion -lt [Version]"5.0") `
-or (-not $PowerShellVersion -and $moduleInfo.PowerShellVersion -and $moduleInfo.PowerShellVersion -lt [Version]"5.0") `
if (($PSVersionTable.PSVersion -lt '5.0.0') -or ($PowerShellVersion -and $PowerShellVersion -lt '5.0') `

@quoctruong Quoc Truong (quoctruong) Aug 19, 2016

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the one on the right hand side be -lt '5.0.0' too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoc Truong (@quoctruong), not required for now, $PowerShellVersion is still of Version type and not SemanticVersion. We will have to make lot of changes to support SemanticVersion type in the module infrastructure.

-or (-not $PowerShellVersion -and $moduleInfo.PowerShellVersion -and $moduleInfo.PowerShellVersion -lt '5.0') `
-or (-not $PowerShellVersion -and -not $moduleInfo.PowerShellVersion))
{
ThrowError -ExceptionName "System.ArgumentException" `
Expand All @@ -13035,8 +13035,8 @@ function Update-ModuleManifest
{
# CompatiblePSEditions field is not available in PowerShell version lower than 5.1
#
if (($PSVersionTable.PSVersion -lt [Version]'5.1') -or ($PowerShellVersion -and $PowerShellVersion -lt [Version]'5.1') `
-or (-not $PowerShellVersion -and $moduleInfo.PowerShellVersion -and $moduleInfo.PowerShellVersion -lt [Version]'5.1') `
if (($PSVersionTable.PSVersion -lt '5.1.0') -or ($PowerShellVersion -and $PowerShellVersion -lt '5.1') `
-or (-not $PowerShellVersion -and $moduleInfo.PowerShellVersion -and $moduleInfo.PowerShellVersion -lt '5.1') `
-or (-not $PowerShellVersion -and -not $moduleInfo.PowerShellVersion))
{
ThrowError -ExceptionName 'System.ArgumentException' `
Expand Down