Skip to content

Commit e14465c

Browse files
committed
Used strong data type for the list variable to avoid string append
1 parent 55034a4 commit e14465c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Refresh-WingetConfiguration.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function Get-ListToArray {
4141
$List
4242
)
4343

44-
$parsedList = @();
44+
[string[]]$parsedList = @();
4545

4646
ForEach ( $item in $list.PSObject.Properties | where { $_.Name -match "[0-9]+" } )
4747
{
@@ -290,8 +290,8 @@ if ( Test-Path -Path $PolicyRegistryLocation ) {
290290

291291
Write-LogFile -InputObject "Configuration received from $PolicyRegistryLocation" -Severity 1;
292292
if ( Test-Path -Path $PolicyListLocation ) {
293-
$list = Get-ItemProperty -Path $PolicyListLocation;
294-
$list = Get-ListToArray -List $list;
293+
$registrylist = Get-ItemProperty -Path $PolicyListLocation;
294+
[string[]]$list = Get-ListToArray -List $registrylist;
295295

296296
$listFileName = "excluded_apps.txt"
297297
if ( $configuration.UseWhiteList ) {

0 commit comments

Comments
 (0)