From 8fa1f1ef61d134e3099387aee5c723025fd8d392 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Fri, 6 Oct 2023 14:16:19 -0400 Subject: [PATCH] adjusted for removal of Remove-File cmdlet --- Fix-EmberkomCloudBackupProductEdition.ps1 | 5 +++-- Fix-WindowsHealth.ps1 | 2 +- Install-DeltekVision.ps1 | 2 +- Install-EmberkomCloudBackup.ps1 | 5 +++-- Install-Wireguard.ps1 | 2 +- Set-EventLogs.ps1 | 7 ------- 6 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 Set-EventLogs.ps1 diff --git a/Fix-EmberkomCloudBackupProductEdition.ps1 b/Fix-EmberkomCloudBackupProductEdition.ps1 index 3487fb8..555cacb 100644 --- a/Fix-EmberkomCloudBackupProductEdition.ps1 +++ b/Fix-EmberkomCloudBackupProductEdition.ps1 @@ -28,5 +28,6 @@ Try { Set-MBSAgentSetting -Edition $AgentEdition -Verbose } Catch { Write-Error $_.Exception.Message } # Delete the desktop icon -"${Env:PUBLIC}\Desktop\Emberkom Backup.LNK", -"${Env:PUBLIC}\Desktop\Emberkom Cloud Backup.LNK" | Remove-File \ No newline at end of file +Write-Output "Removing desktop icon" +Remove-Item -Path "${Env:PUBLIC}\Desktop\Emberkom Backup.LNK" -Force -ErrorAction SilentlyContinue +Remove-Item -Path "${Env:PUBLIC}\Desktop\Emberkom Cloud Backup.LNK" -Force -ErrorAction SilentlyContinue \ No newline at end of file diff --git a/Fix-WindowsHealth.ps1 b/Fix-WindowsHealth.ps1 index 02eede1..7593ca8 100644 --- a/Fix-WindowsHealth.ps1 +++ b/Fix-WindowsHealth.ps1 @@ -1,5 +1,5 @@ # Run SFC to check the filesystem, convert the result from Unicode to UTF8, delete the intermediate $tempFile -$tempFile = Get-RandomTempFile +$tempFile = New-TemporaryFile $(sfc.exe /scannow) | Out-File $tempFile Set-Content -Path $tempFile -Value $(Get-Content -Path $tempFile -Encoding Unicode) -Encoding UTF8 $SFCOutput = Get-Content -Path $tempFile diff --git a/Install-DeltekVision.ps1 b/Install-DeltekVision.ps1 index 59ebaa4..61efa24 100644 --- a/Install-DeltekVision.ps1 +++ b/Install-DeltekVision.ps1 @@ -29,7 +29,7 @@ If ( -not (Test-Path $SHORTCUT_PATH) ) { If ( $BROWSER_PATH ) { Write-Output "Installing Deltek Vision for ${APP_NAME}" - Create-Shortcut -Path "${Env:Public}\Desktop\Deltek Vision.lnk" -TargetPath $BROWSER_PATH -Arguments $VisionURL -Description "Launch Deltek Vision" + New-Shortcut -Path "${Env:Public}\Desktop\Deltek Vision.lnk" -TargetPath $BROWSER_PATH -Arguments $VisionURL -Description "Launch Deltek Vision" } Else { Write-Output "A compatible browser could not be found: ${BROWSER_PATH}" } } diff --git a/Install-EmberkomCloudBackup.ps1 b/Install-EmberkomCloudBackup.ps1 index 6def3b2..8d958cd 100644 --- a/Install-EmberkomCloudBackup.ps1 +++ b/Install-EmberkomCloudBackup.ps1 @@ -42,5 +42,6 @@ Try { Set-MBSAgentSetting -Edition $AgentEdition -Verbose } Catch { Write-Error $_.Exception.Message } # Delete the desktop icon -"${Env:PUBLIC}\Desktop\Emberkom Backup.LNK", -"${Env:PUBLIC}\Desktop\Emberkom Cloud Backup.LNK" | Remove-File \ No newline at end of file +Write-Output "Removing desktop icon" +Remove-Item -Path "${Env:PUBLIC}\Desktop\Emberkom Backup.LNK" -Force -ErrorAction SilentlyContinue +Remove-Item -Path "${Env:PUBLIC}\Desktop\Emberkom Cloud Backup.LNK" -Force -ErrorAction SilentlyContinue \ No newline at end of file diff --git a/Install-Wireguard.ps1 b/Install-Wireguard.ps1 index e4a3e2a..6f09dbe 100644 --- a/Install-Wireguard.ps1 +++ b/Install-Wireguard.ps1 @@ -22,7 +22,7 @@ If ( IsAdmin ) ## Create shortcut on Public desktop If ( $CreateDesktopShortcut ) { - Create-Shortcut -Path "${Env:Public}\Desktop\WireGuard VPN.LNK" -TargetPath "${Env:ProgramFiles}\WireGuard\wireguard.exe" -Description "WireGuard: Fast, Modern, Secure VPN Tunnel" + New-Shortcut -Path "${Env:Public}\Desktop\WireGuard VPN.LNK" -TargetPath "${Env:ProgramFiles}\WireGuard\wireguard.exe" -Description "WireGuard: Fast, Modern, Secure VPN Tunnel" } } Else { Write-Output "Must be an administrator to install WireGuard" } \ No newline at end of file diff --git a/Set-EventLogs.ps1 b/Set-EventLogs.ps1 deleted file mode 100644 index c8a5ba3..0000000 --- a/Set-EventLogs.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -$LogsToEnable = @( -'' -) - -ForEach ( $log in $LogsToEnable ) { - Toggle-Log -Name $log -Enable -}