Disable Toast Notifications
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2021-01-28 06:49:39 +01:00
parent 0430f01067
commit 659aac3c16

View File

@ -101,11 +101,11 @@ If ($MissingProperties.Length -gt 0) {
# Set hostname and description # Set hostname and description
If ($Env:ComputerName -ne $ovfPropertyValues['guestinfo.hostname']) { If ($Env:ComputerName -ne $ovfPropertyValues['guestinfo.hostname']) {
$NewToastSplat = @{ # $NewToastSplat = @{
Title = 'OVF Properties' # Title = 'OVF Properties'
Text = 'Configuring hostname and description...' # Text = 'Configuring hostname and description...'
} # }
New-ToastNotification @NewToastSplat # New-ToastNotification @NewToastSplat
$RenameComputerSplat = @{ $RenameComputerSplat = @{
NewName = $ovfPropertyValues['guestinfo.hostname'] NewName = $ovfPropertyValues['guestinfo.hostname']
@ -128,11 +128,11 @@ If ($Env:ComputerName -ne $ovfPropertyValues['guestinfo.hostname']) {
# Configure network interface # Configure network interface
If ((Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration').IPAddress -NotContains $ovfPropertyValues['guestinfo.ipaddress']) { If ((Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration').IPAddress -NotContains $ovfPropertyValues['guestinfo.ipaddress']) {
$NewToastSplat = @{ # $NewToastSplat = @{
Title = 'OVF Properties' # Title = 'OVF Properties'
Text = 'Configuring network...' # Text = 'Configuring network...'
} # }
New-ToastNotification @NewToastSplat # New-ToastNotification @NewToastSplat
$NewNetIPAddressSplat = @{ $NewNetIPAddressSplat = @{
InterfaceAlias = (Get-NetAdapter).Name InterfaceAlias = (Get-NetAdapter).Name
@ -188,11 +188,11 @@ If ((Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration').IPAddress -NotCon
# Promote to Domain Controller # Promote to Domain Controller
If ((4,5) -NotContains (Get-WmiObject -Class 'Win32_ComputerSystem').DomainRole) { If ((4,5) -NotContains (Get-WmiObject -Class 'Win32_ComputerSystem').DomainRole) {
$NewToastSplat = @{ # $NewToastSplat = @{
Title = 'OVF Properties' # Title = 'OVF Properties'
Text = 'Configuring local administrator password...' # Text = 'Configuring local administrator password...'
} # }
New-ToastNotification @NewToastSplat # New-ToastNotification @NewToastSplat
# Change password of built-in Administrator # Change password of built-in Administrator
$BuiltinAdministrator = (Get-LocalUser | Where-Object {$_.SID -match '-500'}) $BuiltinAdministrator = (Get-LocalUser | Where-Object {$_.SID -match '-500'})
@ -212,11 +212,11 @@ If ((4,5) -NotContains (Get-WmiObject -Class 'Win32_ComputerSystem').DomainRole)
} }
Set-LocalUser @SetLocalUserSplat Set-LocalUser @SetLocalUserSplat
$NewToastSplat = @{ # $NewToastSplat = @{
Title = 'OVF Properties' # Title = 'OVF Properties'
Text = 'Promoting to Domain Controller...' # Text = 'Promoting to Domain Controller...'
} # }
New-ToastNotification @NewToastSplat # New-ToastNotification @NewToastSplat
$ResolveDNSNameSplat = @{ $ResolveDNSNameSplat = @{
Name = "_ldap._tcp.dc._msdcs.$($ovfPropertyValues['addsconfig.domainname'])" Name = "_ldap._tcp.dc._msdcs.$($ovfPropertyValues['addsconfig.domainname'])"
@ -276,11 +276,11 @@ If ((4,5) -NotContains (Get-WmiObject -Class 'Win32_ComputerSystem').DomainRole)
} }
# Wait for Active Directory to become available # Wait for Active Directory to become available
$NewToastSplat = @{ # $NewToastSplat = @{
Title = 'OVF Properties' # Title = 'OVF Properties'
Text = 'Waiting for Active Directory services...' # Text = 'Waiting for Active Directory services...'
} # }
New-ToastNotification @NewToastSplat # New-ToastNotification @NewToastSplat
$Timestamp, $TimeoutMinutes = (Get-Date), 15 $Timestamp, $TimeoutMinutes = (Get-Date), 15
Do { Do {
@ -312,11 +312,11 @@ $GetItemSplat = @{
} }
Get-Item @GetItemSplat | ForEach-Object { Get-Item @GetItemSplat | ForEach-Object {
Try { Try {
$NewToastSplat = @{ # $NewToastSplat = @{
Title = 'OVF Properties' # Title = 'OVF Properties'
Text = "Running script: '$($_.FullName)'" # Text = "Running script: '$($_.FullName)'"
} # }
New-ToastNotification @NewToastSplat # New-ToastNotification @NewToastSplat
$WriteEventLogSplat = @{ $WriteEventLogSplat = @{
LogName = 'Application' LogName = 'Application'
@ -340,11 +340,11 @@ Get-Item @GetItemSplat | ForEach-Object {
} }
} }
$NewToastSplat = @{ # $NewToastSplat = @{
Title = 'OVF Properties' # Title = 'OVF Properties'
Text = "Sequence finished; ready for use!" # Text = "Sequence finished; ready for use!"
} # }
New-ToastNotification @NewToastSplat # New-ToastNotification @NewToastSplat
$WriteEventLogSplat = @{ $WriteEventLogSplat = @{
LogName = 'Application' LogName = 'Application'