-
-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathMyScript.ps1
More file actions
25 lines (19 loc) · 644 Bytes
/
MyScript.ps1
File metadata and controls
25 lines (19 loc) · 644 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<#
This script is supposed to be invoked by
- Test-1-Command-no-conflicts.ps1
- Test-2-Command-conflicts.ps1
- Test-3-File-conflicts.ps1
#>
# Import the module.
Import-Module .\MyModule.psm1
# Now it works "correctly", it calls MyCommand from the module.
Test-ModuleFunction
# A script function.
function Test-ScriptFunction {
'script function Test-ScriptFunction'
}
# An alias with "accidentally" the same name as a module function.
Set-Alias MyCommand Test-ScriptFunction
# Now it may work "not correctly", it may call MyCommand from the script or
# from the module. This depends on how this script is invoked.
Test-ModuleFunction