Skip to content

Commit 2b9c43b

Browse files
committed
Auto-fix PSScriptAnalyzer indentation and whitespace issues
1 parent 6b313f2 commit 2b9c43b

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

SysAdmin-Tools/ActiveDirectory-Management/Iventory-ADWorkstation-Collector.ps1

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<#
1+
<#
22
.SYNOPSIS
33
Interactive PowerShell GUI to Collect System, Network, and User Information from Remote Workstations.
44
@@ -104,34 +104,34 @@ function Collect-Inventory {
104104
}
105105

106106
$Results += [PSCustomObject]@{
107-
Hostname = $Computer
108-
LoggedUser = $User.UserName
109-
OperatingSystem = $OS.Caption
110-
OSVersion = $OS.Version
111-
LastBootTime = ([Management.ManagementDateTimeConverter]::ToDateTime($OS.LastBootUpTime))
112-
IPAddress = $Net.IPAddress -join ', '
113-
MACAddress = $Net.MACAddress
114-
DefaultGateway = $Net.DefaultIPGateway -join ', '
115-
AdapterName = $Net.Description
116-
Domain = $User.Domain
107+
Hostname = $Computer
108+
LoggedUser = $User.UserName
109+
OperatingSystem = $OS.Caption
110+
OSVersion = $OS.Version
111+
LastBootTime = ([Management.ManagementDateTimeConverter]::ToDateTime($OS.LastBootUpTime))
112+
IPAddress = $Net.IPAddress -join ', '
113+
MACAddress = $Net.MACAddress
114+
DefaultGateway = $Net.DefaultIPGateway -join ', '
115+
AdapterName = $Net.Description
116+
Domain = $User.Domain
117117
BIOSManufacturer = $BIOS.Manufacturer
118-
SerialNumber = $BIOS.SerialNumber
118+
SerialNumber = $BIOS.SerialNumber
119119
}
120120
} else {
121121
Log-Message -Message "$Computer is unreachable." -Type "WARNING"
122122
$Results += [PSCustomObject]@{
123-
Hostname = $Computer
124-
LoggedUser = "Unavailable"
125-
OperatingSystem = "Unreachable"
126-
OSVersion = "N/A"
127-
LastBootTime = "N/A"
128-
IPAddress = "N/A"
129-
MACAddress = "N/A"
130-
DefaultGateway = "N/A"
131-
AdapterName = "N/A"
132-
Domain = "N/A"
123+
Hostname = $Computer
124+
LoggedUser = "Unavailable"
125+
OperatingSystem = "Unreachable"
126+
OSVersion = "N/A"
127+
LastBootTime = "N/A"
128+
IPAddress = "N/A"
129+
MACAddress = "N/A"
130+
DefaultGateway = "N/A"
131+
AdapterName = "N/A"
132+
Domain = "N/A"
133133
BIOSManufacturer = "N/A"
134-
SerialNumber = "N/A"
134+
SerialNumber = "N/A"
135135
}
136136
}
137137
} catch {
@@ -179,14 +179,14 @@ $buttonRun.Text = "Run Inventory"
179179
$buttonRun.Location = '10,310'
180180
$buttonRun.Size = '220,40'
181181
$buttonRun.Add_Click({
182-
$computers = Get-ComputerListFromText -inputText $textBox.Text
183-
if ($computers.Count -gt 0) {
184-
$progressBar.Value = 0
185-
Collect-Inventory -Computers $computers -ProgressBar $progressBar
186-
} else {
187-
Show-ErrorMessage -Message "Please provide at least one valid hostname or IP."
188-
}
189-
})
182+
$computers = Get-ComputerListFromText -inputText $textBox.Text
183+
if ($computers.Count -gt 0) {
184+
$progressBar.Value = 0
185+
Collect-Inventory -Computers $computers -ProgressBar $progressBar
186+
} else {
187+
Show-ErrorMessage -Message "Please provide at least one valid hostname or IP."
188+
}
189+
})
190190
$form.Controls.Add($buttonRun)
191191

192192
$buttonClose = New-Object System.Windows.Forms.Button

0 commit comments

Comments
 (0)