joeNOR > 2020-11-01 10:27
<# .SYNOPSIS #>
Param ( # WMI Class to query.
$WMIclass="Win32_NetworkAdapterConfiguration",
# Objects to select in the class.
$WMIobjects=("Description","MACAddress","IPAddress","DefaultIPGateway","ServiceName","Index"),
# First part of the file name, can be anything.
$FilePrefix="Win32_NetworkAdapterConfiguration",
# If no folder is specified, use the TEMP variable.
$FileFolder=$env:TEMP,
# The file name to write the output to.
$FileName="$FilePrefix-$env:computername.txt"
)
Clear-Host
Write-Host -ForegroundColor Red "File saved as: $FileFolder\$FileName"
Write-Host -ForegroundColor White -BackgroundColor DarkBlue "Use -FileFolder <path> and/or -FileName <filename> to override"
gcim -ClassName $WMIclass | Select-Object $WMIobjects | Out-File -FilePath $FileFolder\$FileName
gcim -ClassName $WMIclass | Select-Object $WMIobjects | Format-Table -Wrap -AutoSize
joeNOR > 2020-11-01 14:24
Get-Help .\test.ps1 -full