Skip to content

Commit 7433379

Browse files
committed
[Unattended answer file] Add option to hide PWSH windows
1 parent 6f6956a commit 7433379

File tree

11 files changed

+130
-106
lines changed

11 files changed

+130
-106
lines changed

Panels/Unattend_Files/Addition/NewUnattendWiz.Designer.vb

Lines changed: 119 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Panels/Unattend_Files/Addition/NewUnattendWiz.vb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Public Class NewUnattendWiz
1818

1919
Dim DotNetRuntimeSupported As Boolean
2020
Dim PreferSelfContained As Boolean
21-
Const UnattendGenReleaseTag As String = "2543"
21+
Const UnattendGenReleaseTag As String = "2561"
2222

2323
' Regional Settings Page
2424
Dim ImageLanguages As New List(Of ImageLanguage)
@@ -79,6 +79,7 @@ Public Class NewUnattendWiz
7979
Dim ConfiguredScripts As New List(Of PostInstallScript)
8080
Dim CurrentlyEditedStage As Integer = 0
8181
Dim ScriptsRestartExplorer As Boolean
82+
Dim ScriptsHideWindow As Boolean
8283
' -- Variables for special scripts
8384
' --- Join Path cmdlet constants
8485
' We put the directory separator character next to the environment variable as homedrive and systemdrive don't end with a backslash.
@@ -2070,6 +2071,11 @@ Public Class NewUnattendWiz
20702071
DynaLog.LogMessage("Explorer will be restarted.")
20712072
UnattendGen.StartInfo.Arguments &= " /restartexplorer"
20722073
End If
2074+
DynaLog.LogMessage("Checking if PowerShell windows will be hidden...")
2075+
If ScriptsHideWindow Then
2076+
DynaLog.LogMessage("Windows will be hidden.")
2077+
UnattendGen.StartInfo.Arguments &= " /hidewindows"
2078+
End If
20732079
End If
20742080
If FinalComponents.Count > 0 Then
20752081
ReportMessage("Saving user settings...", 24.75)
@@ -2747,4 +2753,8 @@ Public Class NewUnattendWiz
27472753
"The default script will return a random computer name similar to " & Quote & ExampleName & Quote & CrLf &
27482754
"This can avoid name resolution conflicts.", sender)
27492755
End Sub
2756+
2757+
Private Sub CheckBox22_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox22.CheckedChanged
2758+
ScriptsHideWindow = CheckBox22.Checked
2759+
End Sub
27502760
End Class
512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)