Skip to content

Commit

Permalink
Updated init functions
Browse files Browse the repository at this point in the history
  • Loading branch information
lexiismadd committed Nov 24, 2022
1 parent 7c77b7f commit 25b24fd
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Standard-CT-Module/CT-PS-Standard.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function Initialize-Script {


#Transcript-Log "-------$('-' * $MyInvocation.MyCommand.Name.Length)----------"
Write-Host "**********************"
Write-Host "Script $($ScriptName) starting."
Write-Log "**********************" -verbose:$VerbosePreference
Write-Log "Script $($ScriptName) starting." -verbose:$VerbosePreference

#Transcript-Log "-------$('-' * $MyInvocation.MyCommand.Name.Length)----------"

Expand All @@ -43,8 +43,8 @@ function Initialize-Script {
#Transcript-Log "New folder created at $CT_DEST."
}catch{
#Can't create the folder, therefore cannot continue
Write-Host "Cannot create folder $CT_DEST. $($Error[0].Exception.Message)"
Write-Host $_
Write-Error "Cannot create folder $CT_DEST. $($Error[0].Exception.Message)"
Write-Error $_ -verbose:$VerbosePreference
#Stop-Transcript
exit 1
}
Expand All @@ -56,8 +56,8 @@ function Initialize-Script {
#Transcript-Log "New logs folder created at $CT_DEST."
}catch{
#Can't create the folder, therefore cannot continue
Write-Host "Cannot create logs folder in $CT_DEST. $($Error[0].Exception.Message)"
Write-Host $_
Write-Error "Cannot create logs folder in $CT_DEST. $($Error[0].Exception.Message)"
Write-Error $_ -verbose:$VerbosePreference
#Stop-Transcript
exit 3
}
Expand All @@ -69,8 +69,8 @@ function Initialize-Script {
#Transcript-Log "New logs folder for $($ScriptName) created at $CT_DEST."
}catch{
#Can't create the folder, therefore cannot continue
Write-Host "Cannot create logs folder for $($ScriptName) in $CT_DEST. $($Error[0].Exception.Message)"
Write-Host $_
Write-Error "Cannot create logs folder for $($ScriptName) in $CT_DEST. $($Error[0].Exception.Message)"
Write-Error $_
#Stop-Transcript
exit 4
}
Expand All @@ -84,9 +84,9 @@ function Initialize-Script {
Set-ItemProperty -Path "HKLM:\Software\CT" -Name "CustomerNo" -Value $customer
}catch{
#Can't create the regkey, therefore cannot continue
Write-Host "Cannot create registry key at $($CT_Reg_Key). $($Error[0].Exception.Message)"
Write-Host "$($CTMonitoringReg)"
Write-Host $_
Write-Error "Cannot create registry key at $($CT_Reg_Key). $($Error[0].Exception.Message)"
Write-Error "$($CTMonitoringReg)"
Write-Error $_
#Stop-Transcript
exit 5
}
Expand Down

0 comments on commit 25b24fd

Please sign in to comment.