Fix Remove-Item to not throw an exception

Remove-Item now doesn't throw an exception if can't remove a file.

Closes-Bug: 1270824

Change-Id: I4e8b80d05fd566190ee53661100e2a48ee28cc1c
This commit is contained in:
Dmitry Teselkin 2014-01-20 17:37:11 +04:00
parent 897b391221
commit d1dc9e8313

View File

@ -41,8 +41,8 @@ else {
Write-Log "Updating Murano Windows Agent."
Stop-Service "Murano Agent"
Backup-File $WindowsAgentConfigFile
Remove-Item $WindowsAgentConfigFile -Force
Remove-Item $WindowsAgentLogFile -Force
Remove-Item $WindowsAgentConfigFile -Force -ErrorAction 'SilentlyContinue'
Remove-Item $WindowsAgentLogFile -Force -ErrorAction 'SilentlyContinue'
ConvertFrom-Base64String -Base64String $WindowsAgentConfigBase64 -Path $WindowsAgentConfigFile
Exec sc.exe 'config','"Murano Agent"','start=','delayed-auto'
Write-Log "Service has been updated."