Challenge - 5 Problems
PowerShell Module Manifest Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Output of a basic module manifest property
Given this snippet from a PowerShell module manifest (.psd1), what is the output of the command
$manifest.Author after importing the manifest as a variable?PowerShell
@{RootModule = 'MyModule.psm1'; Author = 'Jane Doe'; ModuleVersion = '1.0.0'}Attempts:
2 left
💡 Hint
Look for the key named 'Author' in the hashtable.
✗ Incorrect
The manifest is a hashtable. Accessing $manifest.Author returns the value for the 'Author' key, which is 'Jane Doe'.
📝 Syntax
intermediate2:00remaining
Correct syntax for specifying RequiredModules in a .psd1
Which option correctly specifies the RequiredModules key in a PowerShell module manifest to require two modules named 'PSReadLine' and 'Pester' with minimum versions 2.0 and 5.0 respectively?
Attempts:
2 left
💡 Hint
RequiredModules expects an array of hashtables with ModuleName and ModuleVersion keys.
✗ Incorrect
The RequiredModules key must be an array of hashtables, each specifying ModuleName and ModuleVersion. Option D follows this format correctly.
🔧 Debug
advanced2:00remaining
Identify the error in this module manifest snippet
This snippet is part of a PowerShell module manifest (.psd1). What error will occur when PowerShell tries to import this manifest?
PowerShell
@{
RootModule = 'MyModule.psm1'
Author = 'John Smith'
ModuleVersion = '1.0.0'
FunctionsToExport = @('Get-Data', 'Set-Data'
}Attempts:
2 left
💡 Hint
Check the brackets and commas in the FunctionsToExport line.
✗ Incorrect
The FunctionsToExport array is missing a closing parenthesis ")" after 'Set-Data', causing a syntax error when parsing the manifest.
🚀 Application
advanced1:30remaining
Determine the number of exported commands from a manifest
Given this module manifest snippet, how many commands will be exported by default when the module is imported?
PowerShell
@{
RootModule = 'MyModule.psm1'
FunctionsToExport = @('Get-Item', 'Set-Item')
CmdletsToExport = @('Invoke-Action')
AliasesToExport = @()
}Attempts:
2 left
💡 Hint
Count all functions, cmdlets, and aliases listed for export.
✗ Incorrect
FunctionsToExport has 2 commands, CmdletsToExport has 1, AliasesToExport is empty. Total exported commands = 2 + 1 + 0 = 3.
🧠 Conceptual
expert1:30remaining
Understanding the role of PrivateData in a module manifest
What is the primary purpose of the
PrivateData key in a PowerShell module manifest (.psd1)?Attempts:
2 left
💡 Hint
Think about data that is not standard manifest keys but useful for module authors or tools.
✗ Incorrect
PrivateData is a hashtable for custom data that PowerShell ignores but can be used by the module or external tools for additional metadata or configuration.