Question: using visual studio code or PowerShell I need to answer the following questions. 1. In Powershell command answer the following questions 1.Find the name of
using visual studio code or PowerShell I need to answer the following questions.
1. In Powershell command answer the following questions
1.Find the name of the Computername and save it in variable called $ComputerName
example: $ComputerName = $env: COMPUTERNAME
2. Use $ComputerName to find the fully qualified domain name save the result to the variable name called $DNSFQDN
Here is half complete statement: $DNSFQDN = Resolve-DnsName
3. $OS = (Get-CimInstance Win32_OperatingSystem -ComputerName $ComputerName).caption
The above command finds the Operating System of the computer using$ComputerName variable as the parameter.
You need to find the how much memory is installed in the computer. Store the output in the variable called $Memory = . Complete the code
4. You need to find when was the computer last rebooted
$Reboot = . Complete the code.
5. You need to find out how much disk space you have in your Drive C:
And store the output in a variable name $DriveSpace
$DriveSpace = . Complete the code
6. You need to find out who was the last person to log on to this computer:
Save the result in the variable called $lastLogOn
$LastlogOn = . Complete the code
7. Print out the value of all the variables with proper prompts.
Example: $ComputerName = $env:COMPUTERNAME
Write-output "Computername: $Computername"; ""
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
