Skip to content

Commit b3a9679

Browse files
committed
Remove trailing whitespace in Set-Shortcut function
Cleaned up unnecessary trailing whitespace throughout the Set-Shortcut function in Install-Defaults.psm1 to improve code readability and maintain consistency.
1 parent 0b9f089 commit b3a9679

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/Install-Defaults.psm1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ function Set-Shortcut {
10161016
[CmdletBinding(SupportsShouldProcess = $true)]
10171017
param (
10181018
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
1019-
[ValidateScript({
1019+
[ValidateScript({
10201020
if (-not (Test-Path -Path $_ -PathType Leaf)) {
10211021
throw "Shortcut file does not exist: $_"
10221022
}
@@ -1071,15 +1071,15 @@ function Set-Shortcut {
10711071
try {
10721072
# Resolve to full path
10731073
$ShortcutPath = Resolve-Path -Path $Path -ErrorAction Stop | Select-Object -ExpandProperty Path
1074-
1074+
10751075
# Load the shortcut
10761076
$Shortcut = $WshShell.CreateShortcut($ShortcutPath)
1077-
1077+
10781078
# Display current values
10791079
Write-LogFile -Message "Current Target: $($Shortcut.TargetPath)"
10801080
Write-LogFile -Message "Current Arguments: $($Shortcut.Arguments)"
10811081
Write-LogFile -Message "Current WorkingDirectory: $($Shortcut.WorkingDirectory)"
1082-
1082+
10831083
# Modify Target if specified
10841084
if ($PSBoundParameters.ContainsKey('Target')) {
10851085
if ($Append) {
@@ -1096,7 +1096,7 @@ function Set-Shortcut {
10961096
}
10971097
}
10981098
}
1099-
1099+
11001100
# Modify Arguments if specified
11011101
if ($PSBoundParameters.ContainsKey('Arguments')) {
11021102
if ($Append) {
@@ -1113,31 +1113,31 @@ function Set-Shortcut {
11131113
}
11141114
}
11151115
}
1116-
1116+
11171117
# Modify WorkingDirectory if specified
11181118
if ($PSBoundParameters.ContainsKey('WorkingDirectory')) {
11191119
if ($PSCmdlet.ShouldProcess($ShortcutPath, "Set working directory to '$WorkingDirectory'")) {
11201120
$Shortcut.WorkingDirectory = $WorkingDirectory
11211121
Write-LogFile -Message "New WorkingDirectory: $WorkingDirectory"
11221122
}
11231123
}
1124-
1124+
11251125
# Modify Description if specified
11261126
if ($PSBoundParameters.ContainsKey('Description')) {
11271127
if ($PSCmdlet.ShouldProcess($ShortcutPath, "Set description to '$Description'")) {
11281128
$Shortcut.Description = $Description
11291129
Write-LogFile -Message "New Description: $Description"
11301130
}
11311131
}
1132-
1132+
11331133
# Modify IconLocation if specified
11341134
if ($PSBoundParameters.ContainsKey('IconLocation')) {
11351135
if ($PSCmdlet.ShouldProcess($ShortcutPath, "Set icon location to '$IconLocation'")) {
11361136
$Shortcut.IconLocation = $IconLocation
11371137
Write-LogFile -Message "New IconLocation: $IconLocation"
11381138
}
11391139
}
1140-
1140+
11411141
# Modify WindowStyle if specified
11421142
if ($PSBoundParameters.ContainsKey('WindowStyle')) {
11431143
$StyleValue = $WindowStyleMap[$WindowStyle]
@@ -1146,13 +1146,13 @@ function Set-Shortcut {
11461146
Write-LogFile -Message "New WindowStyle: $WindowStyle ($StyleValue)"
11471147
}
11481148
}
1149-
1149+
11501150
# Save the shortcut
11511151
if ($PSCmdlet.ShouldProcess($ShortcutPath, "Save shortcut changes")) {
11521152
$Shortcut.Save()
11531153
Write-LogFile -Message "Successfully updated shortcut: $ShortcutPath"
11541154
}
1155-
1155+
11561156
# Return the updated shortcut object for pipeline use
11571157
# return [PSCustomObject]@{
11581158
# Path = $ShortcutPath

0 commit comments

Comments
 (0)