Skip to content
Snippets Groups Projects
Commit 93a1772a authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Rename variables to have common prefixes.

parent 0565dfbf
No related branches found
No related tags found
No related merge requests found
...@@ -247,7 +247,7 @@ function Update-Configuration { ...@@ -247,7 +247,7 @@ function Update-Configuration {
function Copy-ServiceFiles { function Copy-ServiceFiles {
try { try {
Write-Verbose "Looking for source package using pattern: $($Pattern)" Write-Verbose "Looking for source package using pattern: $($Pattern)"
$PkgDir = Get-ChildItem -Path $UpdateBinariesPath -Directory -Name | $PkgDir = Get-ChildItem -Path $UpdPathBinaries -Directory -Name |
Where-Object {$_ -match $Pattern} | Where-Object {$_ -match $Pattern} |
Sort-Object | Sort-Object |
Select-Object -Last 1 Select-Object -Last 1
...@@ -260,7 +260,7 @@ function Copy-ServiceFiles { ...@@ -260,7 +260,7 @@ function Copy-ServiceFiles {
Stop-MyService "Trying to update service using package [$($PkgDir)]." Stop-MyService "Trying to update service using package [$($PkgDir)]."
Copy-Item -Recurse -Force -ErrorAction Stop ` Copy-Item -Recurse -Force -ErrorAction Stop `
-Path "$($UpdateBinariesPath)\$($PkgDir)\$($ServiceName)\*" ` -Path "$($UpdPathBinaries)\$($PkgDir)\$($ServiceName)\*" `
-Destination "$InstallationPath" -Destination "$InstallationPath"
} }
catch { catch {
...@@ -272,7 +272,7 @@ function Copy-ServiceFiles { ...@@ -272,7 +272,7 @@ function Copy-ServiceFiles {
function Update-ServiceBinaries { function Update-ServiceBinaries {
$MarkerFile = "$($UpdateMarkerPath)\$($env:COMPUTERNAME)" $MarkerFile = "$($UpdPathMarkerFiles)\$($env:COMPUTERNAME)"
if (Test-Path "$MarkerFile" -Type Leaf) { if (Test-Path "$MarkerFile" -Type Leaf) {
Log-Debug "Found marker [$($MarkerFile)], not updating service." Log-Debug "Found marker [$($MarkerFile)], not updating service."
Return $False Return $False
...@@ -294,8 +294,8 @@ function Upload-LogFiles { ...@@ -294,8 +294,8 @@ function Upload-LogFiles {
try { try {
Copy-Item -Force -ErrorAction Stop ` Copy-Item -Force -ErrorAction Stop `
-Path "$($LogPath)\service.log" ` -Path "$($LogPath)\service.log" `
-Destination $LogfileUpload -Destination $UploadPathLogs
Write-Verbose "Uploaded logfile to [$($LogfileUpload)]." Log-Debug "Uploaded logfile to [$($UploadPathLogs)]."
} }
catch { catch {
Log-Warning "Uploading logfile FAILED!`n$($_.Exception.Message)" Log-Warning "Uploading logfile FAILED!`n$($_.Exception.Message)"
...@@ -411,19 +411,19 @@ Log-Debug "$($Me) started..." ...@@ -411,19 +411,19 @@ Log-Debug "$($Me) started..."
# first check if the service is installed and running at all # first check if the service is installed and running at all
Ensure-ServiceRunning $ServiceName Ensure-ServiceRunning $ServiceName
$UpdateConfigPath = "$($UpdateSourcePath)\Configs\$($env:COMPUTERNAME)" $UpdPathConfig = "$($UpdateSourcePath)\Configs\$($env:COMPUTERNAME)"
$UpdateMarkerPath = "$($UpdateSourcePath)\Service\UpdateMarkers" $UpdPathMarkerFiles = "$($UpdateSourcePath)\Service\UpdateMarkers"
$UpdateBinariesPath = "$($UpdateSourcePath)\Service\Binaries" $UpdPathBinaries = "$($UpdateSourcePath)\Service\Binaries"
$LogfileUpload = "$($UpdateSourcePath)\Logs\$($env:COMPUTERNAME)" $UploadPathLogs = "$($UpdateSourcePath)\Logs\$($env:COMPUTERNAME)"
Exit-IfDirMissing $InstallationPath "installation" Exit-IfDirMissing $InstallationPath "installation"
Exit-IfDirMissing $LogPath "log files" Exit-IfDirMissing $LogPath "log files"
Exit-IfDirMissing $ConfigPath "configuration files" Exit-IfDirMissing $ConfigPath "configuration files"
Exit-IfDirMissing $UpdateSourcePath "update source" Exit-IfDirMissing $UpdateSourcePath "update source"
Exit-IfDirMissing $UpdateConfigPath "configuration update" Exit-IfDirMissing $UpdPathConfig "configuration update"
Exit-IfDirMissing $UpdateMarkerPath "update marker" Exit-IfDirMissing $UpdPathMarkerFiles "update marker"
Exit-IfDirMissing $UpdateBinariesPath "service binaries update" Exit-IfDirMissing $UpdPathBinaries "service binaries update"
Exit-IfDirMissing $LogfileUpload "log file target" Exit-IfDirMissing $UploadPathLogs "log file target"
# NOTE: Upload-LogFiles is called before AND after the main tasks to make sure # NOTE: Upload-LogFiles is called before AND after the main tasks to make sure
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment