Complete the code to display the current date and time in PowerShell.
Get-Date | [1]Out-File writes to a file instead of showing output.Start-Process starts a new process, not for output.Get-Content reads from files, not for output.The Write-Output cmdlet sends the output to the console, showing the current date and time.
Complete the code to list all running processes in PowerShell.
[1]Get-Service lists services, not processes.Start-Process starts a new process, not lists them.Stop-Process stops a process, not lists them.Get-Process lists all running processes on your computer.
Fix the error in the code to read the content of a file named 'log.txt'.
Get-Content [1]-Path log.txt works but is not needed here.-File log.txt is not a valid parameter.Path log.txt causes syntax error.You can pass the file name directly to Get-Content to read its content.
Fill both blanks to filter processes with CPU usage greater than 100.
Get-Process | Where-Object { $_.CPU [1] [2] }The Where-Object filters processes where CPU is greater than 100.
Fill all three blanks to create a hashtable of process names and their IDs for processes using more than 50 CPU.
$result = @{}; foreach ($p in Get-Process | Where-Object { $_.CPU [3] 50 }) { $result[[1]] = [2] }This creates a hashtable where keys are process names and values are process IDs for processes with CPU usage greater than 50.