From 07fc23a1b565a67c24d8a653302421ebf8a8deb2 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Thu, 29 Apr 2021 22:10:48 +0000 Subject: [PATCH] Adding a silent error for the new-item Without this, an error is outputted saying the file already exists. Could also use -Force if that would be desired behavior instead. --- PowerShell/FSLogixSetup.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/FSLogixSetup.ps1 b/PowerShell/FSLogixSetup.ps1 index fc8d2bd..a7185bb 100644 --- a/PowerShell/FSLogixSetup.ps1 +++ b/PowerShell/FSLogixSetup.ps1 @@ -58,7 +58,7 @@ else { -BackgroundColor Black ` "c:\temp\wvd directory already exists" } -New-Item -Path c:\ -Name New-WVDSessionHost.log -ItemType File +New-Item -Path c:\ -Name New-WVDSessionHost.log -ItemType File -ErrorAction SilentlyContinue Add-Content ` -LiteralPath C:\New-WVDSessionHost.log ` "