ignore errors on status.txt
This commit is contained in:
Родитель
479989fa1c
Коммит
f87b540945
|
@ -1,6 +1,6 @@
|
|||
if (!(Test-Path function:AddToStatus)) {
|
||||
function AddToStatus([string]$line, [string]$color = "Gray") {
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt"
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
Write-Host -ForegroundColor $color $line
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
if (!(Test-Path function:AddToStatus)) {
|
||||
function AddToStatus([string]$line, [string]$color = "Gray") {
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt"
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
Write-Host -ForegroundColor $color $line
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
if (!(Test-Path function:AddToStatus)) {
|
||||
function AddToStatus([string]$line, [string]$color = "Gray") {
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt"
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
Write-Host -ForegroundColor $color $line
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function AddToStatus([string]$line) {
|
||||
([DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line") | Add-Content -Path "c:\agent\status.txt"
|
||||
([DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line") | Add-Content -Path "c:\agent\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
AddToStatus "SetupDockerAgentStart, User: $env:USERNAME"
|
||||
|
|
|
@ -12,7 +12,7 @@ if (Get-ScheduledTask -TaskName SetupVm -ErrorAction Ignore) {
|
|||
}
|
||||
|
||||
function AddToStatus([string]$line) {
|
||||
([DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line") | Add-Content -Path "c:\agent\status.txt"
|
||||
([DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line") | Add-Content -Path "c:\agent\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
function Login-Docker([string]$registry, [string]$registryUsername, [string]$registryPassword)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
if (!(Test-Path function:AddToStatus)) {
|
||||
function AddToStatus([string]$line, [string]$color = "Gray") {
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt"
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
Write-Host -ForegroundColor $color $line
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function AddToStatus([string]$line, [string]$color = "Gray") {
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt"
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
function Register-NativeMethod([string]$dll, [string]$methodSignature)
|
||||
|
|
|
@ -8,7 +8,7 @@ $WindowsProductName = $ComputerInfo.WindowsProductName
|
|||
try {
|
||||
|
||||
function AddToStatus([string]$line, [string]$color = "Gray") {
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt"
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
AddToStatus "SetupVm, User: $env:USERNAME"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
if (!(Test-Path function:AddToStatus)) {
|
||||
function AddToStatus([string]$line, [string]$color = "Gray") {
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt"
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
Write-Host -ForegroundColor $color $line
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ function Get-VariableDeclaration([string]$name) {
|
|||
}
|
||||
|
||||
function AddToStatus([string]$line) {
|
||||
([DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line") | Add-Content -Path "c:\agent\status.txt"
|
||||
([DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line") | Add-Content -Path "c:\agent\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
function Download-File([string]$sourceUrl, [string]$destinationFile)
|
||||
|
|
|
@ -62,7 +62,7 @@ function Get-VariableDeclaration([string]$name) {
|
|||
}
|
||||
|
||||
function AddToStatus([string]$line, [string]$color = "Gray") {
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt"
|
||||
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
function Download-File([string]$sourceUrl, [string]$destinationFile)
|
||||
|
|
Загрузка…
Ссылка в новой задаче