Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit cc12736

Browse files
author
Jonathan Pitre
committed
Fix spacing
1 parent 993056d commit cc12736

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Microsoft/Local Admin Password Solution/Install-Agent.ps1

+16-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#---------------------------------------------------------[Initialisations]--------------------------------------------------------
77

88
#region Initialisations
9+
910
$ProgressPreference = "SilentlyContinue"
1011
$ErrorActionPreference = "SilentlyContinue"
1112
# Set the script execution policy for this process
@@ -78,24 +79,33 @@ Function Get-ScriptName
7879
}
7980
}
8081
}
82+
83+
Function Initialize-Module
8184
{
85+
<#
86+
.SYNOPSIS
87+
Initialize-Module install and import modules from PowerShell Galllery.
88+
.OUTPUTS
89+
System.String
90+
#>
8291
[CmdletBinding()]
8392
Param
8493
(
8594
[Parameter(Mandatory = $true)]
8695
[string]$Module
8796
)
88-
Write-Host -Object "Importing $Module module..." -ForegroundColor Green
97+
Write-Host -Object "Importing $Module module..." -ForegroundColor Green
8998

9099
# If module is imported say that and do nothing
91-
If (Get-Module | Where-Object {$_.Name -eq $Module})
100+
If (Get-Module | Where-Object { $_.Name -eq $Module })
92101
{
93-
Write-Host -Object "Module $Module is already imported." -ForegroundColor Green
102+
Write-Host -Object "Module $Module is already imported." -ForegroundColor Green
94103
}
95104
Else
96105
{
97106
# If module is not imported, but available on disk then import
98-
If (Get-Module -ListAvailable | Where-Object {$_.Name -eq $Module})
107+
If ( [boolean](Get-Module -ListAvailable | Where-Object { $_.Name -eq $Module }) )
108+
99109
{
100110
$InstalledModuleVersion = (Get-InstalledModule -Name $Module).Version
101111
$ModuleVersion = (Find-Module -Name $Module).Version
@@ -136,7 +146,7 @@ Function Get-ScriptName
136146
}
137147

138148
# If module is not imported, not available on disk, but is in online gallery then install and import
139-
If (Find-Module -Name $Module | Where-Object {$_.Name -eq $Module})
149+
If (Find-Module -Name $Module | Where-Object { $_.Name -eq $Module })
140150
{
141151
# Install and import module
142152
Install-Module -Name $Module -AllowClobber -Force -Scope AllUsers
@@ -161,6 +171,7 @@ Foreach ($Module in $Modules)
161171
{
162172
Initialize-Module -Module $Module
163173
}
174+
164175
#endregion
165176

166177
#-----------------------------------------------------------[Functions]------------------------------------------------------------

ShareX/Install.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ If ([version]$appVersion -gt [version]$appInstalledVersion)
251251
Write-Log -Message "Applying customizations..." -Severity 1 -LogType CMTrace -WriteHost $True
252252

253253
Write-Log -Message "Applying $appName settings to the Default User profile." -Severity 1 -LogType CMTrace -WriteHost $True
254+
254255
# Copy config file to the default profile
255256
New-Item -Path "$appDestination" -Name "PersonalPath.cfg" -ItemType File -Value "%ApplicationData%\$appName" -Force
256257
New-Folder -Path "$envSystemDrive\Users\Default\AppData\Roaming\$appName"

0 commit comments

Comments
 (0)