Disable Toast Notifications
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		| @@ -101,11 +101,11 @@ If ($MissingProperties.Length -gt 0) { | ||||
|  | ||||
| # Set hostname and description | ||||
| If ($Env:ComputerName -ne $ovfPropertyValues['guestinfo.hostname']) { | ||||
|     $NewToastSplat = @{ | ||||
|         Title = 'OVF Properties' | ||||
|         Text  = 'Configuring hostname and description...' | ||||
|     } | ||||
|     New-ToastNotification @NewToastSplat | ||||
|     # $NewToastSplat = @{ | ||||
|     #     Title = 'OVF Properties' | ||||
|     #     Text  = 'Configuring hostname and description...' | ||||
|     # } | ||||
|     # New-ToastNotification @NewToastSplat | ||||
|  | ||||
|     $RenameComputerSplat = @{ | ||||
|         NewName     = $ovfPropertyValues['guestinfo.hostname'] | ||||
| @@ -128,11 +128,11 @@ If ($Env:ComputerName -ne $ovfPropertyValues['guestinfo.hostname']) { | ||||
|  | ||||
| # Configure network interface | ||||
| If ((Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration').IPAddress -NotContains $ovfPropertyValues['guestinfo.ipaddress']) { | ||||
|     $NewToastSplat = @{ | ||||
|         Title = 'OVF Properties' | ||||
|         Text  = 'Configuring network...' | ||||
|     } | ||||
|     New-ToastNotification @NewToastSplat | ||||
|     # $NewToastSplat = @{ | ||||
|     #     Title = 'OVF Properties' | ||||
|     #     Text  = 'Configuring network...' | ||||
|     # } | ||||
|     # New-ToastNotification @NewToastSplat | ||||
|  | ||||
|     $NewNetIPAddressSplat = @{ | ||||
|         InterfaceAlias = (Get-NetAdapter).Name | ||||
| @@ -188,11 +188,11 @@ If ((Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration').IPAddress -NotCon | ||||
|  | ||||
| # Promote to Domain Controller | ||||
| If ((4,5) -NotContains (Get-WmiObject -Class 'Win32_ComputerSystem').DomainRole) { | ||||
|     $NewToastSplat = @{ | ||||
|         Title = 'OVF Properties' | ||||
|         Text  = 'Configuring local administrator password...' | ||||
|     } | ||||
|     New-ToastNotification @NewToastSplat | ||||
|     # $NewToastSplat = @{ | ||||
|     #     Title = 'OVF Properties' | ||||
|     #     Text  = 'Configuring local administrator password...' | ||||
|     # } | ||||
|     # New-ToastNotification @NewToastSplat | ||||
|  | ||||
|     # Change password of built-in Administrator | ||||
|     $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 | ||||
|  | ||||
|     $NewToastSplat = @{ | ||||
|         Title = 'OVF Properties' | ||||
|         Text  = 'Promoting to Domain Controller...' | ||||
|     } | ||||
|     New-ToastNotification @NewToastSplat | ||||
|     # $NewToastSplat = @{ | ||||
|     #     Title = 'OVF Properties' | ||||
|     #     Text  = 'Promoting to Domain Controller...' | ||||
|     # } | ||||
|     # New-ToastNotification @NewToastSplat | ||||
|  | ||||
|     $ResolveDNSNameSplat = @{ | ||||
|         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 | ||||
| $NewToastSplat = @{ | ||||
|     Title = 'OVF Properties' | ||||
|     Text  = 'Waiting for Active Directory services...' | ||||
| } | ||||
| New-ToastNotification @NewToastSplat | ||||
| # $NewToastSplat = @{ | ||||
| #     Title = 'OVF Properties' | ||||
| #     Text  = 'Waiting for Active Directory services...' | ||||
| # } | ||||
| # New-ToastNotification @NewToastSplat | ||||
|  | ||||
| $Timestamp, $TimeoutMinutes = (Get-Date), 15 | ||||
| Do { | ||||
| @@ -312,11 +312,11 @@ $GetItemSplat = @{ | ||||
| } | ||||
| Get-Item @GetItemSplat | ForEach-Object { | ||||
|     Try { | ||||
|         $NewToastSplat = @{ | ||||
|             Title = 'OVF Properties' | ||||
|             Text  = "Running script: '$($_.FullName)'" | ||||
|         } | ||||
|         New-ToastNotification @NewToastSplat | ||||
|         # $NewToastSplat = @{ | ||||
|         #     Title = 'OVF Properties' | ||||
|         #     Text  = "Running script: '$($_.FullName)'" | ||||
|         # } | ||||
|         # New-ToastNotification @NewToastSplat | ||||
|  | ||||
|         $WriteEventLogSplat = @{ | ||||
|             LogName   = 'Application' | ||||
| @@ -340,11 +340,11 @@ Get-Item @GetItemSplat | ForEach-Object { | ||||
|     } | ||||
| } | ||||
|  | ||||
| $NewToastSplat = @{ | ||||
|     Title = 'OVF Properties' | ||||
|     Text  = "Sequence finished; ready for use!" | ||||
| } | ||||
| New-ToastNotification @NewToastSplat | ||||
| # $NewToastSplat = @{ | ||||
| #     Title = 'OVF Properties' | ||||
| #     Text  = "Sequence finished; ready for use!" | ||||
| # } | ||||
| # New-ToastNotification @NewToastSplat | ||||
|  | ||||
| $WriteEventLogSplat = @{ | ||||
|     LogName   = 'Application' | ||||
|   | ||||
		Reference in New Issue
	
	Block a user