Skip to content

Commit 40c1a2b

Browse files
committed
fixed parameter on write-log calls
1 parent ba11d63 commit 40c1a2b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

workload/scripts/Set-SessionHostConfiguration.ps1

+9-9
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function New-Log {
4747
$script:logFile = "$Script:Name-$date.log"
4848

4949
if ((Test-Path $path ) -eq $false) {
50-
$null = New-Item -Path $path -type directory
50+
$null = New-Item -Path $path -ItemType directory
5151
}
5252

5353
$script:Log = Join-Path $path $logfile
@@ -354,13 +354,13 @@ try {
354354
}
355355
If ($FsLogixStorageAccountKey -ne '') {
356356
$SAName = $FSLogixStorageFQDN.Split('.')[0]
357-
Write-Log -Message "Adding Local Storage Account Key for '$FSLogixStorageFQDN' to Credential Manager" -Type 'INFO'
357+
Write-Log -Message "Adding Local Storage Account Key for '$FSLogixStorageFQDN' to Credential Manager" -Category 'Info'
358358
$CMDKey = Start-Process -FilePath 'cmdkey.exe' -ArgumentList "/add:$FSLogixStorageFQDN /user:localhost\$SAName /pass:$FSLogixStorageAccountKey" -Wait -PassThru
359359
If ($CMDKey.ExitCode -ne 0) {
360-
Write-Log -Message "CMDKey Failed with '$($CMDKey.ExitCode)'. Failed to add Local Storage Account Key for '$FSLogixStorageFQDN' to Credential Manager" -Type 'ERROR'
360+
Write-Log -Message "CMDKey Failed with '$($CMDKey.ExitCode)'. Failed to add Local Storage Account Key for '$FSLogixStorageFQDN' to Credential Manager" -Category 'Error'
361361
}
362362
Else {
363-
Write-Log -Message "Successfully added Local Storage Account Key for '$FSLogixStorageFQDN' to Credential Manager" -Type 'INFO'
363+
Write-Log -Message "Successfully added Local Storage Account Key for '$FSLogixStorageFQDN' to Credential Manager" -Category 'Info'
364364
}
365365
$Settings += @(
366366
# Attach the users VHD(x) as the computer: https://learn.microsoft.com/en-us/fslogix/reference-configuration-settings?tabs=profiles#accessnetworkascomputerobject
@@ -436,7 +436,7 @@ try {
436436
foreach ($File in $Files) {
437437
Add-MpPreference -ExclusionPath $File
438438
}
439-
Write-Log -Message 'Enabled Defender exlusions for FSLogix paths' -Type 'INFO'
439+
Write-Log -Message 'Enabled Defender exlusions for FSLogix paths' -Category 'Info'
440440

441441
$Processes = @(
442442
"%ProgramFiles%\FSLogix\Apps\frxccd.exe",
@@ -447,7 +447,7 @@ try {
447447
foreach ($Process in $Processes) {
448448
Add-MpPreference -ExclusionProcess $Process
449449
}
450-
Write-Log -Message 'Enabled Defender exlusions for FSLogix processes' -Type 'INFO'
450+
Write-Log -Message 'Enabled Defender exlusions for FSLogix processes' -Category 'Info'
451451
}
452452

453453

@@ -457,13 +457,13 @@ try {
457457
$BootInstaller = 'AVD-Bootloader.msi'
458458
Get-WebFile -FileName $BootInstaller -URL 'https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RWrxrH'
459459
Start-Process -FilePath 'msiexec.exe' -ArgumentList "/i $BootInstaller /quiet /qn /norestart /passive" -Wait -Passthru
460-
Write-Log -Message 'Installed AVD Bootloader' -Type 'INFO'
460+
Write-Log -Message 'Installed AVD Bootloader' -Category 'Info'
461461
Start-Sleep -Seconds 5
462462

463463
$AgentInstaller = 'AVD-Agent.msi'
464464
Get-WebFile -FileName $AgentInstaller -URL 'https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RWrmXv'
465465
Start-Process -FilePath 'msiexec.exe' -ArgumentList "/i $AgentInstaller /quiet /qn /norestart /passive REGISTRATIONTOKEN=$HostPoolRegistrationToken" -Wait -PassThru
466-
Write-Log -Message 'Installed AVD Agent' -Type 'INFO'
466+
Write-Log -Message 'Installed AVD Agent' -Category 'Info'
467467
Start-Sleep -Seconds 5
468468

469469
##############################################################
@@ -474,6 +474,6 @@ try {
474474
}
475475
}
476476
catch {
477-
Write-Log -Message $_ -Type 'ERROR'
477+
Write-Log -Message $_ -Category 'Error'
478478
throw
479479
}

0 commit comments

Comments
 (0)