Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 6 MCQs Advanced PowerShell and Automation

CSC104 — It Fundamentals 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Modules Easy

    Which PowerShell cmdlet loads a module into the current session?

  2. Question 2 of 60 Modules Easy

    Which cmdlet lists modules currently imported into a PowerShell session?

  3. Question 3 of 60 File handling (CSV, JSON, XML) Easy

    Which cmdlet imports data from a CSV file as PowerShell objects?

  4. Question 4 of 60 File handling (CSV, JSON, XML) Easy

    Which cmdlet converts a JSON-formatted string into PowerShell objects?

  5. Question 5 of 60 Menus Easy

    What is a common purpose of a menu in a PowerShell script?

  6. Question 6 of 60 Prompts Easy

    Which cmdlet prompts a user to enter text in the console?

  7. Question 7 of 60 System tasks (services, processes, registry, tasks) Easy

    Which cmdlet displays processes running on a computer?

  8. Question 8 of 60 System tasks (services, processes, registry, tasks) Easy

    Which cmdlet starts a stopped Windows service?

  9. Question 9 of 60 Active Directory Easy

    Which PowerShell cmdlet retrieves an Active Directory user account?

  10. Question 10 of 60 Active Directory Easy

    Which PowerShell module commonly provides cmdlets such as Get-ADUser?

  11. Question 11 of 60 PowerShell Remoting Easy

    Which cmdlet runs a command on one or more remote computers?

  12. Question 12 of 60 PowerShell Remoting Easy

    Which cmdlet starts an interactive PowerShell session with a remote computer?

  13. Question 13 of 60 Jobs Easy

    Which cmdlet starts a PowerShell command as a background job?

  14. Question 14 of 60 Jobs Easy

    Which cmdlet retrieves the results produced by a PowerShell background job?

  15. Question 15 of 60 Scheduled tasks Easy

    What is the main purpose of a scheduled task?

  16. Question 16 of 60 Advanced functions with validation Easy

    Which attribute restricts a PowerShell parameter to a predefined set of values?

  17. Question 17 of 60 GUI scripting Easy

    Which .NET technology can be used to create graphical interfaces in PowerShell?

  18. Question 18 of 60 Automation scripts for user management Easy

    Why might a user-management script read account details from a CSV file?

  19. Question 19 of 60 Log automation Easy

    Which cmdlet retrieves entries from Windows event logs?

  20. Question 20 of 60 System monitoring Easy

    What is the purpose of a basic system-monitoring script?

  21. Question 21 of 60 Modules Medium

    A script requires the ActiveDirectory module. Which command should be used at the beginning of the script to load the module and stop execution if loading fails?

  22. Question 22 of 60 File handling (CSV, JSON, XML) Medium

    A CSV file contains Name and Enabled columns. Which command imports the file and returns only rows where Enabled is the text value True?

  23. Question 23 of 60 File handling (CSV, JSON, XML) Medium

    A nested PowerShell object is being saved as JSON, but properties below the second level are replaced with abbreviated output. Which command best preserves six levels of nested data?

  24. Question 24 of 60 File handling (CSV, JSON, XML) Medium

    An XML configuration file contains <server enabled="true">APP01</server> inside a <servers> element. After loading it with [xml]$config = Get-Content ./config.xml, which expression selects only enabled server nodes?

  25. Question 25 of 60 Menus Medium

    A console menu accepts choices 1, 2, or Q. Which construct most clearly routes each valid choice to a separate action?

  26. Question 26 of 60 Prompts Medium

    A script must request administrator credentials without displaying the password as plain text. Which command is most appropriate?

  27. Question 27 of 60 System tasks (services, processes, registry, tasks) Medium

    A script must restart the Print Spooler only when it is currently running. Which command sequence meets the requirement?

  28. Question 28 of 60 System tasks (services, processes, registry, tasks) Medium

    Which command creates or updates the LogLevel DWORD value under HKLM:\Software\Contoso?

  29. Question 29 of 60 Active Directory Medium

    An administrator must disable all enabled users in the OU=Contractors,DC=example,DC=com organizational unit. Which pipeline performs this task?

  30. Question 30 of 60 PowerShell Remoting Medium

    A command must retrieve the WinRM service from SERVER01 and SERVER02 without creating persistent sessions. Which command should be used?

  31. Question 31 of 60 PowerShell Remoting Medium

    A script runs several commands repeatedly on the same remote computer. Which approach avoids creating a new remote connection for every command?

  32. Question 32 of 60 Jobs Medium

    A background job has completed, and its output must be collected while keeping the job available for later inspection. Which command should be used?

  33. Question 33 of 60 Scheduled tasks Medium

    A PowerShell script must run daily at 2:00 AM under the SYSTEM account. Which set of objects is required before calling Register-ScheduledTask?

  34. Question 34 of 60 Advanced functions with validation Medium

    An advanced function parameter named Environment must accept only Dev, Test, or Prod. Which declaration enforces this rule before the function body runs?

  35. Question 35 of 60 Advanced functions with validation Medium

    A function accepts server names from the pipeline by property name. Which parameter attribute enables objects with a ComputerName property to bind automatically?

  36. Question 36 of 60 GUI scripting Medium

    A Windows Forms button should run code when a user clicks it. Which statement correctly attaches a click event handler?

  37. Question 37 of 60 Automation scripts for user management Medium

    A user-provisioning script imports employee records from CSV. Which design best prevents duplicate Active Directory accounts when the script is run again?

  38. Question 38 of 60 Log automation Medium

    A log-maintenance script must archive .log files older than 30 days. Which filter correctly identifies the files?

  39. Question 39 of 60 System monitoring Medium

    A monitoring script samples processor usage and must alert when the average PercentProcessorTime value exceeds 80. Which approach correctly calculates the average from $samples?

  40. Question 40 of 60 Deployment tasks Medium

    A deployment script installs an MSI package silently and must wait for installation to finish before verifying the application. Which command is most appropriate?

  41. Question 41 of 60 Modules Hard

    A script module defines Get-Report, New-Report, and Remove-Report. The .psm1 file calls Export-ModuleMember -Function Get-Report,New-Report, while the manifest specifies FunctionsToExport = @('Get-Report','Remove-Report'). Which functions are exported when the manifest is imported?

  42. Question 42 of 60 Modules Hard

    A server has versions 2.1.0 and 3.0.0 of Contoso.Tools installed. A script must load at least version 2.0.0 but must never load version 3.0.0 or later. Which command enforces that requirement?

  43. Question 43 of 60 File handling (CSV, JSON, XML) Hard

    A PowerShell object contains nested properties five levels deep. After ConvertTo-Json and ConvertFrom-Json, properties below the default serialization depth are missing or represented incompletely. Which change directly addresses the problem?

  44. Question 44 of 60 File handling (CSV, JSON, XML) Hard

    An XML document uses <d:server> elements under the namespace URI urn:datacenter. Why does Select-Xml -Xml $xml -XPath '//server' return no nodes, and what is the correct approach?

  45. Question 45 of 60 Menus Hard

    A console menu accepts choices 1 through 4. It must reject 2abc, whitespace, and out-of-range integers without throwing an exception. Which validation design is most robust?

  46. Question 46 of 60 Prompts Hard

    An automation script must prompt interactively for credentials and pass them to Invoke-Command without storing the password as plain text in a variable. Which approach is appropriate?

  47. Question 47 of 60 System tasks (services, processes, registry, tasks) Hard

    A 64-bit machine has different values in the 32-bit and 64-bit registry views. A 32-bit PowerShell process must reliably modify the 64-bit HKLM\Software view. Which technique is correct?

  48. Question 48 of 60 System tasks (services, processes, registry, tasks) Hard

    A script locates a process, waits several seconds, and then stops it. Process IDs can be reused during that interval. Which design best reduces the risk of stopping a different process?

  49. Question 49 of 60 Active Directory Hard

    A provisioning script may be rerun after partial failure. It must add a user to a group without failing when the user is already a member. Which pattern is most idempotent?

  50. Question 50 of 60 Active Directory Hard

    A script must find enabled users under one organizational unit whose Department equals the value in $department, while allowing the domain controller to perform the filtering. Which approach is appropriate?

  51. Question 51 of 60 PowerShell Remoting Hard

    After Invoke-Command -ComputerName Server1 { Get-Service BITS }, the returned object is labeled Deserialized.System.ServiceProcess.ServiceController, and its service-control methods are unavailable. What explains this behavior?

  52. Question 52 of 60 PowerShell Remoting Hard

    From workstation A, an administrator remotes to server B. A command on B then attempts to access a protected file share on server C using the administrator's credentials and receives access denied. Which remoting issue is most likely?

  53. Question 53 of 60 Jobs Hard

    A script calls Receive-Job $job once for an interim status display and later calls it again after completion, but the first batch of output is missing from the final collection. Which change preserves previously received output?

  54. Question 54 of 60 Scheduled tasks Hard

    A scheduled PowerShell task must run on a server after reboot even when no user is signed in. It requires elevated local privileges and must not depend on an interactive desktop. Which configuration best meets these requirements?

  55. Question 55 of 60 Advanced functions with validation Hard

    An advanced function accepts server names from the pipeline both by value and by property name. It should collect input in process and perform one batched API call after all pipeline input arrives. Where should the API call be placed?

  56. Question 56 of 60 Advanced functions with validation Hard

    A function parameter must accept only existing leaf files. The function also accepts pipeline input, and validation must occur during parameter binding. Which declaration is most suitable?

  57. Question 57 of 60 GUI scripting Hard

    A WPF PowerShell tool starts a long-running scan directly in a button click handler, causing the window to freeze. Which architecture keeps the interface responsive and updates controls safely?

  58. Question 58 of 60 Automation scripts for user management Hard

    A bulk user-creation script reads a CSV and may stop halfway because of a transient directory failure. Which design most safely supports rerunning the same file?

  59. Question 59 of 60 Log automation Hard

    A script polls a growing text log every minute. It must avoid rereading old lines and must also handle log rotation, where the replacement file can be smaller than the previous file. What state should it persist?

  60. Question 60 of 60 System monitoring Hard

    A monitoring script computes CPU utilization from a cumulative processor-time counter sampled at times and . On an -logical-processor system, which expression gives normalized utilization as a percentage?

That's unit 6

Answer a few questions and your score shows up here.