Skip to content

Commit 66b8b0e

Browse files
updated disclaimer and logos
1 parent 264cd49 commit 66b8b0e

13 files changed

+307
-103
lines changed

Diff for: LICENSE renamed to DISCLAIMER.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
# DISCLAIMER
12
This Sample Code is provided for the purpose of illustration only and is not
2-
intended to be used in a production environment. THIS SAMPLE CODE AND ANY
3+
intended to be used in a production environment. **THIS SAMPLE CODE AND ANY
34
RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
45
EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
5-
MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a
6+
MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE**. We grant You a
67
nonexclusive, royalty-free right to use and modify the Sample Code and to
78
reproduce and distribute the object code form of the Sample Code, provided
89
that You agree: (i) to not use Our name, logo, or trademarks to market Your
@@ -14,4 +15,4 @@ from the use or distribution of the Sample Code.
1415

1516
This posting is provided "AS IS" with no warranties, and confers no rights. Use
1617
of included script samples are subject to the terms specified
17-
at http://www.microsoft.com/info/cpyright.htm.
18+
at https://www.microsoft.com/en-us/legal/copyright.

Diff for: Functions/UIControls.ps1

+6-6
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ Function Add-UITimeZoneList{
302302
param(
303303
$TZCsvList = "$ResourcePath\TimeZonesIndex.csv",
304304
[Parameter(Mandatory = $true, Position=0)]
305-
[System.Windows.Controls.ComboBox]$TimeZoneField,
305+
$TimeZoneField,
306306
[switch]$ReturnList
307307
)
308308
## Get the name of this function
@@ -331,7 +331,7 @@ Function Add-UIDomainNameList{
331331
[Parameter(Mandatory = $true, Position=0)]
332332
[object[]]$DomainList,
333333
[Parameter(Mandatory = $true, Position=1)]
334-
[System.Windows.Controls.ComboBox]$DomainNameField,
334+
$DomainNameField,
335335
[string]$TypeFilter
336336
)
337337
## Get the name of this function
@@ -349,7 +349,7 @@ Function Add-UISiteList{
349349
[Parameter(Mandatory = $true, Position=0)]
350350
$SiteList,
351351
[Parameter(Mandatory = $false, Position=1)]
352-
[System.Windows.Controls.ComboBox]$SiteListField,
352+
$SiteListField,
353353
[string]$DisplayFormat = '<id> - <Baselocation> [<SiteCode>]',
354354
[switch]$ReturnList
355355
)
@@ -426,11 +426,11 @@ Function Update-UILocaleFields {
426426
[string]$SiteID,
427427
[Parameter(Mandatory = $false, Position=1,ParameterSetName="base")]
428428
[string]$Base,
429-
[System.Windows.Controls.ComboBox]$UpdateSiteListObject,
430-
[System.Windows.Controls.ComboBox]$UpdateTimeZoneObject,
429+
$UpdateSiteListObject,
430+
$UpdateTimeZoneObject,
431431
[System.Windows.Controls.TextBox]$UpdateSiteCodeObject,
432432
#[System.Windows.Controls.TextBox]$UpdateDomainObject,
433-
[System.Windows.Controls.ComboBox]$UpdateDomainObject,
433+
$UpdateDomainObject,
434434
[switch]$ReturnProperties
435435
)
436436
## Get the name of this function

Diff for: OSDOOBEUI.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
-->
9191
<UI_Pages>
9292
<Page_SinglePageOnly>True</Page_SinglePageOnly>
93-
<Page_ShowAppSelection>True</Page_ShowAppSelection>
93+
<Page_ShowAppSelection>False</Page_ShowAppSelection>
9494
</UI_Pages>
9595

9696
<!--Name generation rules: validates the current name meets the required info.

Diff for: OSDOOBEUI.ps1

+90-12
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,8 @@ If($MenuShowAppSelection)
703703

704704
#Add apps selection from config
705705
Add-AppContent -AppData $MenuAppButtonsItems
706-
706+
707+
#enable the apptab
707708
$ActiveBeginBtn = Enable-AppTab -FlipButtons -ReturnActiveBtn
708709
}
709710
Else{
@@ -1115,6 +1116,13 @@ $UI.Add_KeyDown({
11151116
#Region CLICKACTION: Allows UI to be updated based input
11161117
(WPFVar "Validate" -Wildcard).Add_Click({
11171118

1119+
#first thing: capture if bypass mode key is pressed
1120+
If($null -ne $MenuAllowRuleBypassModeKey){
1121+
$CaptureBypassModeKey = Test-KeyPress -Keys $MenuAllowRuleBypassModeKey
1122+
}Else{
1123+
$CaptureBypassModeKey = $false
1124+
}
1125+
11181126
Invoke-UIMessage -Message ("Validating device name: {0}" -f (WPFVar "inputTxtComputerName").text) -HighlightObject (WPFVar "inputTxtComputerName") -OutputErrorObject (WPFVar "txtError") -Type Info
11191127
#Reset any highlighted input fields
11201128
Reset-HighlightedFields -Object (WPFVar "input" -Wildcard) -ClearErrorMessage
@@ -1124,6 +1132,7 @@ $UI.Add_KeyDown({
11241132

11251133
#check if name needs to be validated against rules
11261134
If($ValidateComputerName -and $MenuEnableValidateNameRules){
1135+
11271136
$ValidateIdentity = Confirm-ComputerNameRules -SiteList $MenuLocaleSiteList `
11281137
-XmlRules $NameStandardRuleSets `
11291138
-ComputerNameObject (WPFVar "inputTxtComputerName") `
@@ -1143,6 +1152,17 @@ $UI.Add_KeyDown({
11431152
#update site info (and domain) by classification
11441153
Update-UIDomainFields -FilterLocale $ValidateIdentity.Id3 -FilterClass $ValidateIdentity.Id4 `
11451154
-WorkgroupOption:$MenuAllowWorkgroupJoin -ClassificationProperty $MenuShowClassificationProperty
1155+
1156+
If($CaptureBypassModeKey)
1157+
{
1158+
#show it bypass mode was used
1159+
Invoke-UIMessage -Message ('USER BYPASS MODE: Hold [{0}] and press Begin' -f ($MenuAllowRuleBypassModeKey -join "+")) -HighlightObject (WPFVar "inputTxtComputerName") -OutputErrorObject (WPFVar "txtError") -Type OK
1160+
$ValidateIdentity = $true
1161+
1162+
#hide dropdown & enable textbox
1163+
ConvertTo-UITextBox -ComboBox (WPFVar "inputCmbDomainWorkgroupName")
1164+
Switch-TabItem -TabControlObject (WPFVar "subtabControl") -name 'Hardware'
1165+
}
11461166
}
11471167
Else{
11481168
$ValidateIdentity = $ValidateComputerName
@@ -1165,30 +1185,49 @@ $UI.Add_KeyDown({
11651185

11661186

11671187

1188+
11681189
#Region CLICKACTION: Begin will be enabled if validated is run
11691190
$ActiveBeginBtn.Add_Click({
11701191

1192+
#first thing: capture if bypass mode key is pressed
1193+
If($null -ne $MenuAllowRuleBypassModeKey){
1194+
$CaptureBypassModeKey = Test-KeyPress -Keys $MenuAllowRuleBypassModeKey
1195+
}Else{
1196+
$CaptureBypassModeKey = $false
1197+
}
1198+
11711199
#Reset any highlighted input fields
11721200
Reset-HighlightedFields -Object (WPFVar "input" -Wildcard) -ClearErrorMessage
11731201

1174-
#first check if the computer name meets basic standards
1175-
$ValidateComputerName = Confirm-ComputerNameField -ComputerNameObject (WPFVar "inputTxtComputerName") -OutputErrorObject (WPFVar "txtError") -ExcludeExample $NameStandardRuleExampleText
1202+
If($CaptureBypassModeKey){
1203+
$ValidateComputerName = $true
1204+
}
1205+
Else{
1206+
#first check if the computer name meets basic standards
1207+
$ValidateComputerName = Confirm-ComputerNameField -ComputerNameObject (WPFVar "inputTxtComputerName") -OutputErrorObject (WPFVar "txtError") -ExcludeExample $NameStandardRuleExampleText
1208+
}
11761209

11771210
#check if name needs to be validated against rules (only if basic computer name is valid)
1178-
If($ValidateComputerName -and $MenuEnableValidateNameRules)
1211+
If($CaptureBypassModeKey){
1212+
$ValidateComputerNameRules = $true
1213+
}
1214+
ElseIf($ValidateComputerName -and $MenuEnableValidateNameRules)
11791215
{
11801216
$ValidateComputerNameRules = Confirm-ComputerNameRules -SiteList $MenuLocaleSiteList `
1181-
-XmlRules $NameStandardRuleSets `
1182-
-ComputerNameObject (WPFVar "inputTxtComputerName") `
1183-
-OutputErrorObject (WPFVar "txtError") -ReturnOption Variables
1217+
-XmlRules $NameStandardRuleSets `
1218+
-ComputerNameObject (WPFVar "inputTxtComputerName") `
1219+
-OutputErrorObject (WPFVar "txtError") -ReturnOption Variables
11841220
Set-OSDIdentityVariables -VariableTable $ValidateComputerNameRules
11851221
}
11861222
Else{
11871223
$ValidateComputerNameRules = $true
11881224
}
11891225

11901226
#check if site code needs to be validated.
1191-
If($MenuShowSiteCode)
1227+
If($CaptureBypassModeKey){
1228+
$ValidateSiteCode = $true
1229+
}
1230+
ElseIf($MenuShowSiteCode)
11921231
{
11931232
$ValidateSiteCode = Confirm-SiteCode -SiteCodeObject (WPFVar "txtSiteCode") -OutputErrorObject (WPFVar "txtError")
11941233
}
@@ -1197,7 +1236,13 @@ $ActiveBeginBtn.Add_Click({
11971236
}
11981237

11991238
#check if admin credentials are valid format. Ignor if using ODJ
1200-
If($MenuGenerateNameMethod -like 'ODJ*'){
1239+
If($CaptureBypassModeKey){
1240+
$ValidateAdminCreds = $true
1241+
}
1242+
ElseIf($MenuGenerateNameMethod -like 'ODJ*'){
1243+
$ValidateAdminCreds = $true
1244+
}
1245+
ElseIf($MenuHideDomainList -or $MenuHideDomainCreds){
12011246
$ValidateAdminCreds = $true
12021247
}
12031248
Else{
@@ -1209,6 +1254,25 @@ $ActiveBeginBtn.Add_Click({
12091254
#all check must be valid to preceed
12101255
If($ValidateSiteCode -and $ValidateComputerName -and $ValidateComputerNameRules -and $ValidateAdminCreds)
12111256
{
1257+
#Build Parameters for OSD Variables
1258+
$OSDParams = @{ComputerName=(WPFVar "inputTxtComputerName").Text}
1259+
If($MenuHideDomainList -ne $true){
1260+
If( (WPFVar "inputTxtDomainWorkgroupName").Text -eq 'Workgroup' ){
1261+
$OSDParams += @{DomainName=(WPFVar "inputTxtDomainWorkgroupName").Text}
1262+
}Else{
1263+
$OSDParams += @{DomainName=(WPFVar "inputTxtDomainWorkgroupName").Text;DomainOU=(WPFVar "inputCmbDomainOU").Text}
1264+
}
1265+
}
1266+
If($MenuHideDomainCreds -ne $true){
1267+
If( (WPFVar "inputTxtDomainWorkgroupName").Text -eq 'Workgroup' ){
1268+
$OSDParams += @{LocalAdminPassword=(WPFVar "inputTxtPassword").Password}
1269+
}Else{
1270+
$OSDParams += @{AdminUsername=(WPFVar "inputTxtDomainAdminLocalAccount").Text;AdminPassword=(WPFVar "inputTxtPassword").Password}
1271+
}
1272+
}
1273+
$OSDParams += @{CMSiteCode=(WPFVar "txtSiteCode").Text}
1274+
1275+
12121276
#Set OSD variables for ODJ Join using a file
12131277
If($MenuGenerateNameMethod -eq 'ODJFile'){
12141278
Set-OSDOdjVariables -BlobFile $DeviceODJ.FullName -ComputerName (WPFVar "inputTxtComputerName").Text -LocalAdminPassword (WPFVar "inputTxtPassword").Password
@@ -1217,19 +1281,33 @@ $ActiveBeginBtn.Add_Click({
12171281
ElseIf($MenuGenerateNameMethod -eq 'ODJBlob'){
12181282
Set-OSDOdjVariables -BlobData $ODJBlobData -ComputerName (WPFVar "inputTxtComputerName").Text -DomainName (WPFVar "inputTxtDomainWorkgroupName").Text
12191283
}
1284+
ElseIf($MenuHideDomainList -and $MenuHideDomainCreds){
1285+
Set-OSDDomainVariables -ComputerName (WPFVar "inputTxtComputerName").Text
1286+
}
12201287
#Set OSD variables for Workgroup Join
12211288
ElseIf( ((WPFVar "inputTxtDomainWorkgroupName").Text -eq 'Workgroup')){
1222-
Set-OSDWorkgroupVariables -ComputerName (WPFVar "inputTxtComputerName").Text -Workgroup (WPFVar "inputTxtDomainAdminLocalAccount").Text `
1289+
If($MenuHideDomainCreds){
1290+
Set-OSDWorkgroupVariables -ComputerName (WPFVar "inputTxtComputerName").Text -Workgroup (WPFVar "inputTxtDomainAdminLocalAccount").Text
1291+
}Else{
1292+
Set-OSDWorkgroupVariables -ComputerName (WPFVar "inputTxtComputerName").Text -Workgroup (WPFVar "inputTxtDomainAdminLocalAccount").Text `
12231293
-LocalAdminPassword (WPFVar "inputTxtPassword").Password
1294+
}
12241295
}
12251296
#Set OSD variables for Domain Join
12261297
Else{
1227-
Set-OSDDomainVariables -ComputerName (WPFVar "inputTxtComputerName").Text -DomainName (WPFVar "inputTxtDomainWorkgroupName").Text -DomainOU (WPFVar "inputCmbDomainOU").Text`
1298+
$DomainName = $MenuLocaleDomainList | Where {$_.FQDN -eq (WPFVar "inputTxtDomainWorkgroupName").Text} | Select -ExpandProperty Name
1299+
If($MenuHideDomainCreds){
1300+
1301+
Set-OSDDomainVariables -ComputerName (WPFVar "inputTxtComputerName").Text -DomainName $DomainName -DomainFQDN (WPFVar "inputTxtDomainWorkgroupName").Text -DomainOU (WPFVar "inputCmbDomainOU").Text`
1302+
-CMSiteCode (WPFVar "txtSiteCode").Text
1303+
}Else{
1304+
Set-OSDDomainVariables -ComputerName (WPFVar "inputTxtComputerName").Text -DomainName $DomainName -DomainFQDN (WPFVar "inputTxtDomainWorkgroupName").Text -DomainOU (WPFVar "inputCmbDomainOU").Text`
12281305
-AdminUsername (WPFVar "inputTxtDomainAdminLocalAccount").Text -AdminPassword (WPFVar "inputTxtPassword").Password `
12291306
-CMSiteCode (WPFVar "txtSiteCode").Text
1307+
}
12301308
}
12311309
#Set OSD variables for Timezones/Locale
1232-
Set-OSDLocaleVariables -TimeZone ($AllTimeZones | Where DisplayName -eq (WPFVar "inputCmbTimeZoneList").SelectedItem)
1310+
Set-OSDLocaleVariables -SelectedTimeZone ($AllTimeZones | Where {$_.TimeZone -eq (WPFVar "inputCmbTimeZoneList").SelectedItem})
12331311
#Set OSD variables for Applications
12341312
If($MenuShowAppSelection){Set-OSDAppVariables -AppObjects (WPFVar "tglAppInstall" -Wildcard) -AppList $MenuAppButtonsItems}
12351313
#Set OSD variables for Classification

Diff for: OSDOOBEUI_SinglePage.ps1

+15-4
Original file line numberDiff line numberDiff line change
@@ -1261,8 +1261,13 @@ $ActiveBeginBtn.Add_Click({
12611261
#Reset any highlighted input fields
12621262
Reset-HighlightedFields -Object (WPFVar "input" -Wildcard) -ClearErrorMessage
12631263

1264-
#first check if the computer name meets basic standards
1265-
$ValidateComputerName = Confirm-ComputerNameField -ComputerNameObject (WPFVar "inputTxtComputerName") -OutputErrorObject (WPFVar "txtError") -ExcludeExample $NameStandardRuleExampleText
1264+
If($CaptureBypassModeKey){
1265+
$ValidateComputerName = $true
1266+
}
1267+
Else{
1268+
#first check if the computer name meets basic standards
1269+
$ValidateComputerName = Confirm-ComputerNameField -ComputerNameObject (WPFVar "inputTxtComputerName") -OutputErrorObject (WPFVar "txtError") -ExcludeExample $NameStandardRuleExampleText
1270+
}
12661271

12671272
#check if name needs to be validated against rules (only if basic computer name is valid)
12681273
If($CaptureBypassModeKey){
@@ -1281,7 +1286,10 @@ $ActiveBeginBtn.Add_Click({
12811286
}
12821287

12831288
#check if site code needs to be validated.
1284-
If($MenuShowSiteCode)
1289+
If($CaptureBypassModeKey){
1290+
$ValidateSiteCode = $true
1291+
}
1292+
ElseIf($MenuShowSiteCode)
12851293
{
12861294
$ValidateSiteCode = Confirm-SiteCode -SiteCodeObject (WPFVar "txtSiteCode") -OutputErrorObject (WPFVar "txtError")
12871295
}
@@ -1290,7 +1298,10 @@ $ActiveBeginBtn.Add_Click({
12901298
}
12911299

12921300
#check if admin credentials are valid format. Ignor if using ODJ
1293-
If($MenuGenerateNameMethod -like 'ODJ*'){
1301+
If($CaptureBypassModeKey){
1302+
$ValidateAdminCreds = $true
1303+
}
1304+
ElseIf($MenuGenerateNameMethod -like 'ODJ*'){
12941305
$ValidateAdminCreds = $true
12951306
}
12961307
ElseIf($MenuHideDomainList -or $MenuHideDomainCreds){

0 commit comments

Comments
 (0)