0
0
PowerShellscripting~10 mins

Script modules vs binary modules in PowerShell - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import a script module named 'MyModule'.

PowerShell
Import-Module [1]
Drag options to blanks, or click blank then click option'
AMyModule.exe
BMyModule.dll
CMyModule.psm1
DMyModule.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using the '.dll' file to import a script module.
Trying to import an executable or text file as a module.
2fill in blank
medium

Complete the code to import a binary module named 'NetModule'.

PowerShell
Import-Module [1]
Drag options to blanks, or click blank then click option'
ANetModule.psm1
BNetModule.ps1
CNetModule.txt
DNetModule.dll
Attempts:
3 left
💡 Hint
Common Mistakes
Using the '.psm1' file to import a binary module.
Trying to import a script file as a binary module.
3fill in blank
hard

Fix the error in the command to import a script module named 'Utils'.

PowerShell
Import-Module Utils[1]
Drag options to blanks, or click blank then click option'
A.dll
B.psm1
C.exe
D.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using '.dll' extension for script modules.
Omitting the extension or using wrong file types.
4fill in blank
hard

Fill both blanks to create a script module file and import it.

PowerShell
New-Item -Path . -Name [1] -ItemType File
Import-Module [2]
Drag options to blanks, or click blank then click option'
AHelper.psm1
CHelper.dll
DHelper.ps1
Attempts:
3 left
💡 Hint
Common Mistakes
Creating a '.ps1' file but importing as a module.
Using '.dll' extension for script modules.
5fill in blank
hard

Fill all three blanks to check if a module is binary or script by its extension.

PowerShell
switch -Wildcard ($moduleName) {
  '*.psm1' { $type = '[1]' }
  '*.dll' { $type = '[2]' }
  default { $type = '[3]' }
}
Drag options to blanks, or click blank then click option'
AScriptModule
BBinaryModule
CUnknownModule
DExecutableModule
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing '.dll' with script modules.
Using wrong labels for module types.