WinpeOutGridView.psm1

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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
<#
    .NOTES
    --------------------------------------------------------------------------------
     Created with: SAPIEN Technologies, Inc., PowerShell Studio 2018 v5.5.152
     Generated on: 11/24/2019 2:14 PM
     Generated by: Technician 420ƋȠƮ TM
     Organization: Custom Builds Real Solutions
    --------------------------------------------------------------------------------
    .DESCRIPTION
        'PowerShell 7.0.0 Preview 5 and Microsoft.PowerShell.GraphicalTools Module
        Developed by The PowerShell Team over at Microsoft, Is what made me make
        the Permanent switch to PowerShell Core and ditch the desktop version.
        My Module WinpeOutGridView is my first real module i wrote to come up with
        a real solution for what i was un able to find online. This module is servel
        solutions,
        example 1. WinPE Out-GridView to Remove-WindowsDrivers, Remove-WindowsPackages
        Remove-AppxProvisionedPackages, Disable-WindowsFeatures.
        example 2 Needed a way to display progress for AppxProvisionedPackages and
        Remove-WindowsDrivers. Write-Progress ForEach-Object.
        With my module WinpeOutGridView and PowerShell Teams Microsoft.PowerShell.GraphicalTools
        allows the user to select as many packages, drivers, appxprovisionedpackages,
        windowsoptionalfeatures from a list a remove or disable with a few clicks
        and will display a progress bar with total number and current number in progress..'
#>



<#
    ===========================================================================
     Created with: SAPIEN Technologies, Inc., PowerShell Studio 2018 v5.5.152
     Created on: 11/24/2019 2:11 PM
     Created by: Technician 420ƋȠƮ TM
     Organization: Custom Builds Real Solutions
     Filename: WinpeOutGridView.psm1
    -------------------------------------------------------------------------
     Module Name: WinpeOutGridView
    ===========================================================================
#>


Function Disable-WindowsOptionalFeatures
{
    $scriptblock =
    {
        # -- Place Your Commands Here
        function Select-OptionalFeature
        {
            param
            (
                [Object][Parameter(Mandatory = $true, ValueFromPipeline = $true, HelpMessage = 'Data to process')]
                $InputObject
            )
            process
            {
                "FeatureName = $($InputObject.FeatureName)"
                Get-WindowsOptionalFeature -Path $MountPath |
                Where-Object -Property FeatureName -EQ -Value $OptionalFeature.FeatureName |
                Disable-WindowsOptionalFeature -Path $MountPath -Remove
            }
        }
        $application = New-Object -ComObject Shell.Application
        $MountPath = ($application.BrowseForFolder(0, 'Select a folder', 0)).Self.Path
        Get-WindowsOptionalFeature -Path $MountPath |
        Select-Object -Property FeatureName, State |
        Sort-Object -Property State |
        Export-Csv -Path .\OptionalFeatures.csv
        $Feature = (Import-Csv -Path .\OptionalFeatures.csv)
        $Features = $Feature | Out-GridView -Title 'Select WindowsOptionalFeatures and Disable and Remove.' -PassThru
        
        $OptionalFeatures = $Features
        $CurrentOptionalFeature = 0
        foreach ($OptionalFeature in $OptionalFeatures)
        {
            Write-Progress -Id 1 -Activity 'Disabling and Removing WindowsOptionalFeatures' -PercentComplete (($CurrentOptionalFeature / $OptionalFeatures.Count) * 100) -Status "($($CurrentOptionalFeature + 1)/$($OptionalFeatures.Count)) Current OptionalFeature: $OptionalFeature"
            $CurrentOptionalFeature++
            Start-Sleep -Milliseconds 250
            Write-Progress -Id 2 -Activity 'Disabling and Removing WindowsOptionalFeatures' -Completed
            
            $OptionalFeature | Select-OptionalFeature
        }
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}

Function Disable-WindowsOptionalFeaturesOnline
{
    $scriptblock =
    {
        # -- Place Your Commands Here
        function Select-OptionalFeature
        {
            param
            (
                [Object][Parameter(Mandatory = $true, ValueFromPipeline = $true, HelpMessage = 'Data to process')]
                $InputObject
            )
            process
            {
                "FeatureName = $($InputObject.FeatureName)"
                Get-WindowsOptionalFeature -Online |
                Where-Object -Property FeatureName -EQ -Value $OptionalFeature.FeatureName |
                Disable-WindowsOptionalFeature -Online -Remove
            }
        }
        Get-WindowsOptionalFeature -Online |
        Select-Object -Property FeatureName, State |
        Sort-Object -Property State |
        Export-Csv -Path .\OptionalFeatures.csv
        $Feature = (Import-Csv -Path .\OptionalFeatures.csv)
        $Features = $Feature | Out-GridView -Title 'Online Image: Select WindowsOptionalFeatures and Disable and Remove.' -PassThru
        
        $OptionalFeatures = $Features
        $CurrentOptionalFeature = 0
        foreach ($OptionalFeature in $OptionalFeatures)
        {
            Write-Progress -Id 1 -Activity 'Online Image: Disabling and Removing WindowsOptionalFeatures' -PercentComplete (($CurrentOptionalFeature / $OptionalFeatures.Count) * 100) -Status "($($CurrentOptionalFeature + 1)/$($OptionalFeatures.Count)) Current OptionalFeature: $OptionalFeature"
            $CurrentOptionalFeature++
            Start-Sleep -Milliseconds 250
            Write-Progress -Id 2 -Activity 'Online Image: Disabling and Removing WindowsOptionalFeatures' -Completed
            
            $OptionalFeature | Select-OptionalFeature
        }
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}

function Get-DiskPartition
{
     <#
 .NOTES
        Partitions can be mapped to their disks using the Win32_DiskDriveToDiskPartition class,
        and drives can be mapped to their partitions via the Win32_LogicalDiskToPartition class.
#>

    
    Get-WmiObject Win32_DiskDrive | ForEach-Object {
        $disk = $_
        $partitions = "ASSOCIATORS OF " +
        "{Win32_DiskDrive.DeviceID='$($disk.DeviceID)'} " +
        "WHERE AssocClass = Win32_DiskDriveToDiskPartition"
        Get-WmiObject -Query $partitions | ForEach-Object {
            $partition = $_
            $drives = "ASSOCIATORS OF " +
            "{Win32_DiskPartition.DeviceID='$($partition.DeviceID)'} " +
            "WHERE AssocClass = Win32_LogicalDiskToPartition"
            Get-WmiObject -Query $drives | ForEach-Object{
                New-Object -TypeName PSCustomObject -Property @{
                    Disk                                     = $disk.DeviceID
                    DiskSize                     = [math]::Round($disk.Size / 1GB, 2)
                    DiskModel                 = $disk.Model
                    Partition                 = $partition.Name
                    RawSize                         = [math]::Round($partition.Size / 1GB, 2)
                    DriveLetter         = $_.DeviceID
                    VolumeName             = $_.VolumeName
                    Size                                     = [math]::Round($_.Size / 1GB, 2)
                    FreeSpace                 = [math]::Round($_.FreeSpace /1gb, 2)
                }
            }
        }
    }
}

function Get-SystemInformation
{
    Get-ComputerInfo -Property ('WindowsBuildLabEx', 'WindowsCurrentVersion', 'WindowsEditionId', 'WindowsProductName', ' WindowsSystemRoot',
        'WindowsVersion', 'BiosBIOSVersion', 'BiosCaption', 'BiosDescription', 'BiosFirmwareType', 'BiosManufacturer', 'BiosName',
        'BiosReleaseDate', 'BiosSerialNumber', 'BiosSMBIOSBIOSVersion', 'BiosSMBIOSMajorVersion', 'BiosSMBIOSPresent', 'BiosSoftwareElementState',
        'BiosStatus', 'BiosSystemBiosMajorVersion', 'BiosVersion', 'CsDNSHostName', 'CsDomain', ' CsDomainRole', 'CsManufacturer', 'CsModel',
        'CsName', 'CsNetworkServerModeEnabled', 'CsNumberOfLogicalProcessors', 'CsNumberOfProcessors', 'CsProcessors', 'CsOEMStringArray',
        'CsPartOfDomain', 'CsPCSystemType', 'CsSystemFamily', 'CsSystemSKUNumber', 'CsSystemType', 'CsWorkgroup', 'OsName', 'OsType',
        'OsOperatingSystemSKU', 'OsVersion', 'OsBuildNumber', 'OsSystemDevice', 'OsSystemDirectory', 'OsSystemDrive', 'OsWindowsDirectory',
        'OsBuildType', 'OsCodeSet', 'OsDataExecutionPreventionAvailable', 'OsDataExecutionPrevention32BitApplications', 'OsDataExecutionPreventionDrivers',
        'OsEncryptionLevel', 'OsArchitecture')
}

Function Remove-AppxProvisionedPackages
{
    $scriptblock =
    {
        # -- Place Your Commands Here
        function Select-AppxProvisonedPackage
        {
            param
            (
                [Object][Parameter(Mandatory = $true, ValueFromPipeline = $true, HelpMessage = 'Data to process')]
                $InputObject
            )
            process
            {
                "PackageName = $($InputObject.PackageName)"
                Get-AppxProvisionedPackage -Path $MountPath |
                Where-Object -Property PackageName -EQ -Value $AppxProvisionedPackage.PackageName |
                Remove-AppxProvisionedPackage -Path $MountPath
            }
        }
        
        $application = New-Object -ComObject Shell.Application
        $MountPath = ($application.BrowseForFolder(0, 'Select a folder', 0)).Self.Path
        Get-AppxProvisionedPackage -Path $MountPath |
        Select-Object -Property PackageName |
        Export-Csv -Path .\Appxprovisioned.csv
        $Appx = (Import-Csv -Path .\AppxProvisioned.csv)
        $AppxPackages = $Appx | Out-GridView -Title 'Offline Image: Select and Remove AppxProvisionedPackages' -PassThru
        
        $AppxProvisionedPackages = $AppxPackages
        $CurrentAppxProvisionedPackage = 0
        foreach ($AppxProvisionedPackage in $AppxProvisionedPackages)
        {
            Write-Progress -Id 1 -Activity 'Offline Image: Removing AppxProvisionedPackages' -PercentComplete (($CurrentAppxProvisionedPackage / $AppxProvisionedPackages.Count) * 100) -Status "($($CurrentAppxProvisionedPackage + 1)/$($AppxProvisionedPackages.Count)) Current AppxProvisionedPackage: $AppxProvisionedPackage"
            $CurrentAppxProvisionedPackage++
            Start-Sleep -Milliseconds 500
            Write-Progress -Id 2 -Activity 'Offline Image: Removing AppxProvisionedPackages' -Completed
            
            $AppxProvisionedPackage | Select-AppxProvisonedPackage
        }
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}

Function Remove-AppxProvisionedPackagesOnline
{
    $scriptblock =
    {
        # -- Place Your Commands Here
        function Select-AppxProvisonedPackage
        {
            param
            (
                [Parameter(Mandatory = $true, ValueFromPipeline = $true, HelpMessage = 'Data to process')]
                $InputObject
            )
            process
            {
                "PackageName = $($InputObject.PackageName)"
                Get-AppxProvisionedPackage -Online |
                Where-Property PackageName -EQ -Value $AppxProvisionedPackage.PackageName |
                Remove-AppxProvisionedPackage -Online
            }
        }
        Get-AppxProvisionedPackage -Online |
        Select-Object -Property PackageName |
        Export-Csv -Path .\Appxprovisioned.csv
        $Appx = (Import-Csv -Path .\AppxProvisioned.csv)
        $AppxPackages = $Appx | Out-GridView -Title 'Online Image: Select and Remove AppxProvisionedPackages' -PassThru
        
        $AppxProvisionedPackages = $AppxPackages
        $CurrentAppxProvisionedPackage = 0
        foreach ($AppxProvisionedPackage in $AppxProvisionedPackages)
        {
            Write-Progress -Id 1 -Activity 'Online Image:: Removing AppxProvisionedPackages' -PercentComplete (($CurrentAppxProvisionedPackage / $AppxProvisionedPackages.Count) * 100) -Status "($($CurrentAppxProvisionedPackage + 1)/$($AppxProvisionedPackages.Count)) Current AppxProvisionedPackage: $AppxProvisionedPackage"
            $CurrentAppxProvisionedPackage++
            Start-Sleep -Milliseconds 500
            Write-Progress -Id 2 -Activity 'Online Image:: Removing AppxProvisionedPackages' -Completed
            
            $AppxProvisionedPackage | Select-AppxProvisonedPackage
        }
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}

Function Remove-WindowsDrivers
{
    $scriptblock =
    {
        # -- Place Your Commands Here
        function Select-WindowsDrivers
        {
            param
            (
                [Parameter(Mandatory = $true, ValueFromPipeline = $true, HelpMessage = 'Data to process')]
                $InputObject
            )
            process
            {
                "OriginalFileName = $($InputObject.OriginalFileName)"
                Get-WindowsDriver -Path $MountPath |
                Where-Object -Property OriginalFileName -EQ -Value $WindowsDriver.OriginalFileName |
                Remove-WindowsDriver -Path $MountPath
            }
        }
        $application = New-Object -ComObject Shell.Application
        $MountPath = ($application.BrowseForFolder(0, 'Select a folder', 0)).Self.Path
        Get-WindowsDriver -Path $MountPath |
        Select-Object -Property Driver, OriginalFileName, ClassName, ProviderName, BootCritical, Date |
        Export-Csv -Path .\WindowsDrivers.csv
        $Inf = (Import-Csv -Path .\WindowsDrivers.csv)
        $Drivers = $Inf | Out-GridView -Title 'Offline Image: Select and Remove Windows Drivers' -PassThru
        $WindowsDrivers = $Drivers
        $CurrentWindowsDriver = 0
        foreach ($WindowsDriver in $WindowsDrivers)
        {
            Write-Progress -Id 1 -Activity 'Offline Image: Removing WindowsDrivers' -PercentComplete (($CurrentWindowsDriver / $WindowsDrivers.Count) * 100) -Status "($($CurrentWindowsDriver + 1)/$($WindowsDrivers.Count)) Current WindowsDriver: $WindowsDriver"
            $CurrentWindowsDriver++
            Start-Sleep -Milliseconds 500
            Write-Progress -Id 2 -Activity 'Offline Image: Removing WindowsDrivers' -Completed
            $WindowsDriver | Select-WindowsDrivers
        }
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}

Function Remove-WindowsPackages
{
    $scriptblock =
    {
        # -- Place Your Commands Here
        function Select-WindowsPackages
        {
            param
            (
                [Object][Parameter(Mandatory = $true, ValueFromPipeline = $true, HelpMessage = 'Data to process')]
                $InputObject
            )
            process
            {
                "PackageName = $($InputObject.PackageName)"
                Get-WindowsPackage -Path $MountPath |
                Where-Object -Property PackageName -EQ -Value $WindowsPackage.PackageName |
                Remove-WindowsPackage -Path $MountPath
            }
        }
        
        $application = New-Object -ComObject Shell.Application
        $MountPath = ($application.BrowseForFolder(0, 'Select a folder', 0)).Self.Path
        Get-WindowsPackage -Path $MountPath |
        Select-Object -Property PackageName |
        Export-Csv -Path .\WindowsPackage.csv
        $Apps = (Import-Csv -Path .\WindowsPackage.csv)
        $Packages = $Apps | Out-GridView -Title 'Offline Image: Select and Remove WindowsPackages' -PassThru
        
        $WindowsPackages = $Packages
        $CurrentWindowsPackage = 0
        foreach ($WindowsPackage in $WindowsPackages)
        {
            Write-Progress -Id 1 -Activity 'Offline Image: Select and Remove WindowsPackages' -PercentComplete (($CurrentWindowsPackage / $WindowsPackages.Count) * 100) -Status "($($CurrentWindowsPackage + 1)/$($WindowsPackages.Count)) Current WindowsPackage: $WindowsPackage"
            $CurrentWindowsPackage++
            Start-Sleep -Milliseconds 250
            Write-Progress -Id 2 -Activity 'Offline Image: Select and Remove WindowsPackages' -Completed
            
            $WindowsPackage | Select-WindowsPackages
        }
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}

Function Remove-WindowsPackagesOnline
{
    $scriptblock =
    {
        # -- Place Your Commands Here
        function Select-WindowsPackages
        {
            param
            (
                [Object][Parameter(Mandatory = $true, ValueFromPipeline = $true, HelpMessage = 'Data to process')]
                $InputObject
            )
            process
            {
                "PackageName = $($InputObject.PackageName)"
                Get-WindowsPackage -Online |
                Where-Object -Property PackageName -EQ -Value $WindowsPackage.PackageName |
                Remove-WindowsPackage -Online
            }
        }
        Get-WindowsPackage -Online |
        Select-Object -Property PackageName |
        Export-Csv -Path .\WindowsPackage.csv
        $Apps = (Import-Csv -Path .\WindowsPackage.csv)
        $Packages = $Apps | Out-GridView -Title 'Online Image: Select and Remove WindowsPackages' -PassThru
        
        $WindowsPackages = $Packages
        $CurrentWindowsPackage = 0
        foreach ($WindowsPackage in $WindowsPackages)
        {
            Write-Progress -Id 1 -Activity 'Online Image: Select and Remove WindowsPackages' -PercentComplete (($CurrentWindowsPackage / $WindowsPackages.Count) * 100) -Status "($($CurrentWindowsPackage + 1)/$($WindowsPackages.Count)) Current WindowsPackage: $WindowsPackage"
            $CurrentWindowsPackage++
            Start-Sleep -Milliseconds 250
            Write-Progress -Id 2 -Activity 'Online Image: Select and Remove WindowsPackages' -Completed
            
            $WindowsPackage | Select-WindowsPackages
        }
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}

Function Set-ScratchSpace
{
    $scriptblock =
    {
        # -- Place Your Commands Here
        [CmdletBinding()]
        param
        (
            [ValidateSet('C:\PerfLogs', 'C:\WinPE_x64\Mount')]
            [string]$Path = $MountPath
        )
        # -- Windows PE boot.wim Set-ScratchSpace:512
        $Today
        $application = New-Object -ComObject Shell.Application
        $MountPath = ($application.BrowseForFolder(0, 'Select a folder', 0)).Self.Path
        Write-Verbose -Message ' Windows PE boot.wim Set-ScratchSpace:512'
        & "$env:windir\system32\dism.exe" /image:$MountPath /Set-ScratchSpace:512
        Start-Sleep -Seconds 3
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}

Function Start-AnalyzeComponentStore
{
    $scriptblock =
    {
        # -- Place Your Commands Here
        [CmdletBinding()]
        param
        (
            [ValidateSet('C:\PerfLogs', 'C:\WinPE_x64\Mount')]
            [string]$Path = $MountPath
        )
        # -- Cleanup-Image /AnalyzeComponentStore Select Path GUI
        $application = New-Object -ComObject Shell.Application
        $MountPath = ($application.BrowseForFolder(0, 'Select a folder', 0)).Self.Path
        & "$env:windir\system32\dism.exe" /image:$MountPath /Cleanup-Image /AnalyzeComponentStore
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}

Function Start-ComponentCleanup
{
    $scriptblock =
    {
        param
        (
            [ValidateSet('C:\PerfLogs', 'C:\WinPE_x64\Mount')]
            [string]$Path = $MountPath
        )
        
        # -- Cleanup-Image /StartComponentCleanup Select Path GUI
        $application = New-Object -ComObject Shell.Application
        $MountPath = ($application.BrowseForFolder(0, 'Select a folder', 0)).Self.Path
        & "$env:windir\system32\dism.exe" /image:$MountPath /Cleanup-Image /StartComponentCleanup
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}

Function Start-ComponentResetBase
{
    $scriptblock =
    {
        param
        (
            [Parameter(Mandatory = $false)]
            [ValidateSet('C:\PerfLogs', 'C:\WinPE_x64\Mount')]
            [string]$Path = $MountPath
        )
        # -- Cleanup-Image /StartComponentCleanup /ResetBase Select Path GUI
        $application = New-Object -ComObject Shell.Application
        $MountPath = ($application.BrowseForFolder(0, 'Select a folder', 0)).Self.Path
        & "$env:windir\system32\dism.exe" /image:$MountPath /Cleanup-Image /StartComponentCleanup /ResetBase /ScratchDir:D:\Scratch
    }
    $encoded = [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptblock))
    & "$env:ComSpec" /c start pwsh -NoExit -EncodedCommand $encoded
}


Export-ModuleMember -Function Disable-WindowsOptionalFeatures,
                                                                                Disable-WindowsOptionalFeaturesOnline,
                                                                                Get-DiskPartition,
                                                                                Get-SystemInformation,
                                                                                Remove-AppxProvisionedPackages,
                                                                                Remove-AppxProvisionedPackagesOnline,
                                                                                Remove-WindowsDrivers,
                                                                                Remove-WindowsPackages,
                                                                                Remove-WindowsPackagesOnline,
                                                                                Set-ScratchSpace,
                                                                                Start-AnalyzeComponentStore,
                                                                                Start-ComponentCleanup,
                                                                                Start-ComponentResetBase