Question: DEBUG the following code: ################## START OF CODE ################## function get-systemInfo () { $computerName! = $env:computername $computerOS = (Get-ItemProperty 'HKLM:SOFTWAREMicrosoftWindows NTCurrentVersion' -Name ProductName).ProductName $osversion =
DEBUG the following code:
################## START OF CODE ##################
function get-systemInfo () { $computerName! = $env:computername $computerOS = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name ProductName).ProductName $osversion = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name CurrentBuild).CurrentBuild $network = Get-NetIPAddress -InterfaceAlias "*Ethernet*" -AddressFamily "IPv4" | Select-Object IPAddress $ip = $network.IPAddress Write-Host "Computer Name: $computerName" Write-Host "Operating System: $computerOS $osversion" Write-Host "IP Address: $ips" } get-systemInformation |
################## END OF CODE ##################
Once you have successfully got the code to run with no errors, it should look like something similar below...
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
