-
Notifications
You must be signed in to change notification settings - Fork 0
/
code.ps1
71 lines (52 loc) · 1.78 KB
/
code.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<#---------------
| Functions
#---------------#>
<#---------------
| Xaml Objects
#---------------#>
#region TabItem: Environment
$WPFComputernameLabel.Content = $env:COMPUTERNAME
$WPFPSVersionLabel.Content = $PSVersionTable.PSVersion.ToString()
if ($PSVersionTable.PSVersion.Major -eq 5) {
$WPFOSLabel.Content = "Windows"
}
else {
$WPFOSLabel.Content = $PSVersionTable.OS
}
Get-Module -Name Hyper-ConvertImage,Microsoft.Graph.Intune, WindowsAutoPilotIntune, Intune.HV.Tools -ListAvailable | Sort-Object Name | ForEach-Object {
$WPFmoduleGrid.AddChild([pscustomobject]@{
ModuleType = $_.ModuleType
Version = $_.Version
Name = $_.Name
})
}
#endregion
#region TabItem: hvconfig.json
$HVToolsConfig = Get-HVToolsConfig
$WPFhvConfigPathLabel.Content = $HVToolsConfig.hvConfigPath
$WPFvmPathLabel.Content = $HVToolsConfig.vmPath
$WPFvSwitchNameLabel.Content = $HVToolsConfig.vSwitchName
$WPFvLanIdLabel.Content = $HVToolsConfig.vLanId
$HVToolsConfig.tenantConfig | ForEach-Object {
$WPFTenantGrid.AddChild([PSCustomObject]@{
TenantName = $_.TenantName
ImageName = $_.ImageName
AdminUpn = $_.AdminUpn
})
}
$HVToolsConfig.images | ForEach-Object {
$WPFImagesGrid.AddChild([PSCustomObject]@{
imageName = $_.imageName
imagePath = $_.imagePath
refImagePath = $_.refImagePath
})
}
#endregion
#Reference
#Adding items to a dropdown/combo box
#$vmpicklistView.items.Add([pscustomobject]@{'VMName'=($_).Name;Status=$_.Status;Other="Yes"})
#Setting the text of a text box to the current PC name
#$WPFtextBox.Text = $env:COMPUTERNAME
#Adding code to a button, so that when clicked, it pings a system
# $WPFbutton.Add_Click({ Test-connection -count 1 -ComputerName $WPFtextBox.Text
# })