Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
briantist committed Jul 9, 2022
1 parent b7ae73e commit 8db3006
Showing 1 changed file with 49 additions and 49 deletions.
98 changes: 49 additions & 49 deletions plugins/modules/win_psmodule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ $skip_publisher_check = Get-AnsibleParam -obj $params -name "skip_publisher_chec
$allow_prerelease = Get-AnsibleParam -obj $params -name "allow_prerelease" -type "bool" -default $false
$accept_license = Get-AnsibleParam -obj $params -name "accept_license" -type "bool" -default $false

$result = @{changed = $false
output = ""
nuget_changed = $false
$result = @{changed = $false
output = ""
nuget_changed = $false
repository_changed = $false
}

Expand Down Expand Up @@ -72,7 +72,7 @@ Function Install-PrereqModule {
# Those are minimum required versions of modules.
$PrereqModules = @{
PackageManagement = '1.1.7'
PowerShellGet = '1.6.0'
PowerShellGet = '1.6.0'
}

[Bool]$PrereqModulesInstalled = $true
Expand All @@ -88,11 +88,11 @@ Function Install-PrereqModule {
else {
try {
$install_params = @{
Name = $Name
Name = $Name
MinimumVersion = $PrereqModules[$Name]
Force = $true
WhatIf = $CheckMode
AcceptLicense = $AcceptLicense
Force = $true
WhatIf = $CheckMode
AcceptLicense = $AcceptLicense
}
$installCmd = Get-Command -Name Install-Module
if ($installCmd.Parameters.ContainsKey('SkipPublisherCheck')) {
Expand Down Expand Up @@ -135,7 +135,7 @@ Function Get-PsModule {
)

$ExistingModule = @{
Exists = $false
Exists = $false
Version = ""
}

Expand Down Expand Up @@ -164,8 +164,8 @@ Function Get-PsModule {
}
elseif ( $MinimumVersion -and $MaximumVersion ) {
$ReturnedModule = $ExistingModules |
Where-Object -FilterScript { $MinimumVersion -le $_.Version -and $MaximumVersion -ge $_.Version } |
Select-Object -First 1
Where-Object -FilterScript { $MinimumVersion -le $_.Version -and $MaximumVersion -ge $_.Version } |
Select-Object -First 1
}
elseif ( $MinimumVersion ) {
$ReturnedModule = $ExistingModules | Where-Object -FilterScript { $MinimumVersion -le $_.Version } | Select-Object -First 1
Expand Down Expand Up @@ -220,10 +220,10 @@ Function Install-PsModule {
)

$getParams = @{
Name = $Name
Name = $Name
RequiredVersion = $RequiredVersion
MinimumVersion = $MinimumVersion
MaximumVersion = $MaximumVersion
MinimumVersion = $MinimumVersion
MaximumVersion = $MaximumVersion
}
$ExistingModuleBefore = Get-PsModule @getParams

Expand All @@ -233,9 +233,9 @@ Function Install-PsModule {
Install-NugetProvider -CheckMode $CheckMode

$ht = @{
Name = $Name
WhatIf = $CheckMode
Force = $true
Name = $Name
WhatIf = $CheckMode
Force = $true
AcceptLicense = $AcceptLicense
}

Expand Down Expand Up @@ -272,9 +272,9 @@ Function Remove-PsModule {
if (Get-Module -Listavailable | Where-Object { $_.name -eq $Name }) {
try {
$ht = @{
Name = $Name
Name = $Name
Confirm = $false
Force = $true
Force = $true
}

$ExistingModuleBefore = Get-PsModule -Name $Name -RequiredVersion $RequiredVersion -MinimumVersion $MinimumVersion -MaximumVersion $MaximumVersion
Expand Down Expand Up @@ -353,8 +353,8 @@ Function Install-Repository {
"Use community.windows.win_psrepository to manage repos"
)
$result.deprecations += @{
msg = $msg
date = "2021-07-01"
msg = $msg
date = "2021-07-01"
collection_name = "community.windows"
}
# Install NuGet provider if needed.
Expand Down Expand Up @@ -389,8 +389,8 @@ Function Remove-Repository {
$result.deprecations = @()
}
$result.deprecations += @{
msg = "Removing a repo with this module is deprecated, use community.windows.win_psrepository to manage repos"
date = "2021-07-01"
msg = "Removing a repo with this module is deprecated, use community.windows.win_psrepository to manage repos"
date = "2021-07-01"
collection_name = "community.windows"
}

Expand Down Expand Up @@ -478,17 +478,17 @@ if ($state -eq "present") {

if ($name) {
$ht = @{
Name = $name
RequiredVersion = $required_version
MinimumVersion = $minimum_version
MaximumVersion = $maximum_version
Repository = $repo
AllowClobber = $allow_clobber
Name = $name
RequiredVersion = $required_version
MinimumVersion = $minimum_version
MaximumVersion = $maximum_version
Repository = $repo
AllowClobber = $allow_clobber
SkipPublisherCheck = $skip_publisher_check
AllowPrerelease = $allow_prerelease
CheckMode = $check_mode
Credential = $repo_credential
AcceptLicense = $accept_license
AllowPrerelease = $allow_prerelease
CheckMode = $check_mode
Credential = $repo_credential
AcceptLicense = $accept_license
}
Install-PsModule @ht
}
Expand All @@ -500,23 +500,23 @@ elseif ($state -eq "absent") {

if ($name) {
$ht = @{
Name = $Name
CheckMode = $check_mode
Name = $Name
CheckMode = $check_mode
RequiredVersion = $required_version
MinimumVersion = $minimum_version
MaximumVersion = $maximum_version
MinimumVersion = $minimum_version
MaximumVersion = $maximum_version
}
Remove-PsModule @ht
}
}
elseif ( $state -eq "latest") {

$ht = @{
Name = $Name
Name = $Name
AllowPrerelease = $allow_prerelease
Repository = $repo
CheckMode = $check_mode
Credential = $repo_credential
Repository = $repo
CheckMode = $check_mode
Credential = $repo_credential
}

$LatestVersion = Find-LatestPsModule @ht
Expand All @@ -526,15 +526,15 @@ elseif ( $state -eq "latest") {
if ( $LatestVersion.Version -ne $ExistingModule.Version ) {

$ht = @{
Name = $Name
RequiredVersion = $LatestVersion
Repository = $repo
AllowClobber = $allow_clobber
Name = $Name
RequiredVersion = $LatestVersion
Repository = $repo
AllowClobber = $allow_clobber
SkipPublisherCheck = $skip_publisher_check
AllowPrerelease = $allow_prerelease
CheckMode = $check_mode
Credential = $repo_credential
AcceptLicense = $accept_license
AllowPrerelease = $allow_prerelease
CheckMode = $check_mode
Credential = $repo_credential
AcceptLicense = $accept_license
}
Install-PsModule @ht
}
Expand Down

0 comments on commit 8db3006

Please sign in to comment.