Skip to content

Commit

Permalink
Update New-HuduAssetLayout.ps1
Browse files Browse the repository at this point in the history
Fixed switch validation to remove OR conditions and flattening them out to individual checks
  • Loading branch information
greenlighttec authored Jun 30, 2024
1 parent cd5ce21 commit 3a6539b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions HuduAPI/Public/New-HuduAssetLayout.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,14 @@ function New-HuduAssetLayout {
'dropdown' { $field.'field_type' = 'Dropdown' }
'embed' { $field.'field_type' = 'Embed' }
'phone' { $field.'field_type' = 'Phone' }
('email' -or 'copyabletext') { $field.'field_type' = 'Email' }
('assettag' -or 'assetlink') { $field.'field_type' = 'AssetTag' }
('website' -or 'link') { $field.'field_type' = 'Website' }
('password' -or 'confidentialtext') { $field.'field_type' = 'Password' }
'email' { $field.'field_type' = 'Email' }
'copyabletext' { $field.'field_type' = 'Email' }
'assettag' { $field.'field_type' = 'AssetTag' }
'assetlink' { $field.'field_type' = 'AssetTag' }
'website' { $field.'field_type' = 'Website' }
'link' { $field.'field_type' = 'Website' }
'password' { $field.'field_type' = 'Password' }
'confidentialtext' { $field.'field_type' = 'Password' }
Default { Write-Error "Invalid field type: $($field.'field_type') found in field $($field.name)"; break }
}
}
Expand Down

0 comments on commit 3a6539b

Please sign in to comment.