Bird
0
0

Given this snippet from a module manifest (.psd1):

medium📝 Command Output Q4 of 15
PowerShell - Modules and Script Organization
Given this snippet from a module manifest (.psd1):
@{
  ModuleVersion = '1.2.3'
  CompatiblePSEditions = @('Desktop', 'Core')
}

What will Get-Module -ListAvailable show for CompatiblePSEditions?
AAn array containing 'Desktop' and 'Core'
BA single string 'Desktop, Core'
CAn error because arrays are not allowed
DEmpty value because CompatiblePSEditions is missing
Step-by-Step Solution
Solution:
  1. Step 1: Understand CompatiblePSEditions format

    The CompatiblePSEditions key accepts an array of strings specifying supported PowerShell editions.
  2. Step 2: Check the given snippet

    The snippet correctly assigns an array with 'Desktop' and 'Core'. PowerShell will show this array as is.
  3. Final Answer:

    An array containing 'Desktop' and 'Core' -> Option A
  4. Quick Check:

    CompatiblePSEditions = array [OK]
Quick Trick: CompatiblePSEditions accepts arrays of edition names [OK]
Common Mistakes:
  • Thinking it must be a single string
  • Assuming arrays cause errors in manifest
  • Confusing CompatiblePSEditions with RequiredModules

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes