Challenge - 5 Problems
PowerShell Module Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Difference in creation between script and binary modules
Which statement correctly describes how script modules and binary modules are created in PowerShell?
Attempts:
2 left
💡 Hint
Think about the file extensions and how PowerShell loads code.
✗ Incorrect
Script modules are PowerShell script files with the .psm1 extension. Binary modules are compiled .NET DLL files that PowerShell loads as modules.
💻 Command Output
intermediate2:00remaining
Output of Get-Module for script vs binary modules
Given a script module and a binary module loaded in PowerShell, what will the 'ModuleType' property show for each when running Get-Module?
PowerShell
Get-Module -Name MyScriptModule, MyBinaryModule | Select-Object Name, ModuleType
Attempts:
2 left
💡 Hint
ModuleType reflects how the module was implemented.
✗ Incorrect
Script modules show 'Script' as ModuleType, binary modules show 'Binary'.
📝 Syntax
advanced2:00remaining
Correct syntax to import a binary module
Which command correctly imports a binary module named 'MyBinaryModule' located in the default module path?
Attempts:
2 left
💡 Hint
Import-Module uses -Name for modules in the module path regardless of type.
✗ Incorrect
Import-Module -Name works for both script and binary modules if they are in the module path.
🔧 Debug
advanced2:00remaining
Error when importing a binary module
You try to import a binary module with Import-Module -Name MyBinaryModule but get the error: 'Could not load file or assembly'. What is the most likely cause?
Attempts:
2 left
💡 Hint
Check if the DLL file exists where PowerShell expects it.
✗ Incorrect
The error usually means PowerShell cannot find or load the DLL file for the binary module.
🚀 Application
expert3:00remaining
Choosing module type for performance and extensibility
You need to create a PowerShell module that requires high performance and access to .NET features not available in PowerShell scripts. Which module type should you choose and why?
Attempts:
2 left
💡 Hint
Think about compiled code vs interpreted scripts.
✗ Incorrect
Binary modules are compiled .NET assemblies, offering better performance and full access to .NET features compared to script modules.