Skip to content

Commit 0a0cf86

Browse files
authored
Merge pull request #19 from jonconwayuk/DEV
Update Pwsh-Gather.ps1
2 parents 9d1f09a + 1d8ce29 commit 0a0cf86

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

Pwsh-Gather.ps1

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<#
22
.DESCRIPTION
3-
Script to replace MDT Gather in SCCM Task Sequences
3+
Script to replace MDT Gather in MEMCM Task Sequences
44
.EXAMPLE
55
PowerShell.exe -ExecutionPolicy ByPass -File <ScriptName>.ps1 [-Debug]
66
.NOTES
77
Author(s): Jonathan Conway
8-
Modified: 13/08/2020
9-
Version: 1.6
8+
Modified: 21/12/2020
9+
Version: 1.7
1010
#>
1111

1212
Param (
@@ -125,7 +125,7 @@ function Get-ChassisInfo {
125125
}
126126

127127
$DesktopChassisTypes = @('3', '4', '5', '6', '7', '13', '15', '16', '35', '36')
128-
$LatopChassisTypes = @('8', '9', '10', '11', '12', '14', '18', '21')
128+
$LaptopChassisTypes = @('8', '9', '10', '11', '12', '14', '18', '21')
129129
$ServerChassisTypes = @('23', '28')
130130
$TabletChassisTypes = @('30', '31', '32')
131131

@@ -148,10 +148,10 @@ function Get-ChassisInfo {
148148
}
149149

150150
if ($TSvars.ContainsKey('IsLaptop')) {
151-
$TSvars['IsLaptop'] = [string]$LatopChassisTypes.Contains($_.ToString())
151+
$TSvars['IsLaptop'] = [string]$LaptopChassisTypes.Contains($_.ToString())
152152
}
153153
else {
154-
$TSvars.Add('IsLaptop', [string]$LatopChassisTypes.Contains($_.ToString()))
154+
$TSvars.Add('IsLaptop', [string]$LaptopChassisTypes.Contains($_.ToString()))
155155
$TSvars.Add('IsDesktop', "$false")
156156
$TSvars.Add('IsServer', "$false")
157157
$TSvars.Add('IsTablet', "$false")
@@ -166,7 +166,7 @@ function Get-ChassisInfo {
166166
$TSvars.Add('IsLaptop', "$false")
167167
$TSvars.Add('IsTablet', "$false")
168168
}
169-
169+
170170
if ($TSvars.ContainsKey('IsTablet')) {
171171
$TSvars['IsTablet'] = [string]$TabletChassisTypes.Contains($_.ToString())
172172
}
@@ -195,10 +195,10 @@ function Get-HardwareInfo {
195195
$Processor = Get-CimInstance -ClassName 'Win32_Processor'
196196

197197
if ($Processor.Manufacturer -eq 'GenuineIntel') {
198-
198+
199199
$ProcessorName = $Processor.Name
200200
$ProcessorFamily = $ProcessorName.Substring($ProcessorName.LastIndexOf('-') + 1, 4)
201-
201+
202202
if ($ProcessorFamily -ge '8000') {
203203
$IsCoffeeLakeOrLater = $true
204204
}
@@ -211,7 +211,7 @@ function Get-HardwareInfo {
211211
$TSvars.Add('ProcessorName', $ProcessorName)
212212

213213
}
214-
214+
215215
$TSvars.Add('ProcessorManufacturer', $Processor.Manufacturer)
216216
$TSvars.Add('ProcessorSpeed', $Processor.MaxClockSpeed.ToString())
217217

@@ -220,7 +220,7 @@ function Get-HardwareInfo {
220220
function Get-NetworkInfo {
221221

222222
(Get-CimInstance -ClassName 'Win32_NetworkAdapterConfiguration' -Filter 'IPEnabled = 1') | ForEach-Object {
223-
223+
224224
# Get IP address information
225225
$_.IPAddress | ForEach-Object {
226226
if ($_ -ne $null) {
@@ -262,8 +262,8 @@ function Get-NetworkInfo {
262262
}
263263

264264
$TSvars.Add('IsOnEthernet', "$IsOnEthernet")
265-
266-
# Get device MAC addresses for conencted NICs
265+
266+
# Get device MAC addresses for connected NICs
267267
$Nic = (Get-CimInstance -ClassName 'Win32_NetworkAdapter' -Filter 'NetConnectionStatus = 2')
268268

269269
$TSvars.Add('MacAddress', $Nic.MACAddress -join ',')
@@ -315,7 +315,7 @@ Get-OsInfo
315315
if ($Debug) {
316316

317317
Start-Transcript -Path "$env:windir\Temp\Pwsh-Gather.log" -Append -NoClobber
318-
318+
319319
$TSvars.Keys | Sort-Object | ForEach-Object {
320320
Write-Host "$($_) = $($TSvars[$_])"
321321
}
@@ -326,7 +326,7 @@ if ($Debug) {
326326

327327
# If Debug is false then add variables to the Task Sequence environment
328328
else {
329-
329+
330330
$tsenv = New-Object -ComObject Microsoft.SMS.TSEnvironment
331331
$temp = $tsenv.Value("OSDComputerName")
332332
$LogPath = $tsenv.Value("_SMSTSLogPath")

0 commit comments

Comments
 (0)