Module Partially Loads With Import-Module
Votes from Connect: 13
Original Date Submitted: 1/6/2012 5:20:17 AM
Description:
Contact Information
Handle: Steve Murawski
Site Name: PowerShell
Feedback ID: 716857
Frequency: Always Happens
Regression: Yes, this happens in previous released versions
Problem Description:
When Import-Module is called with one of the Alias, Cmdlet, Function, or Variable parameters, but not any of the others, the module only partially loads (based on what parameter you specified), but attempting to access commands that were not directly referenced by the specified parameter results in (replace the name of the command with whatever command you want to test with).
The term 'Get-DataCollectorSet' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:4 char:1
+ Get-DataCollectorSet -Server PatrolCar
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-DataCollectorSet:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Product Studio item created by Connect Synchronizer due to creation of feedback ID 716857 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=716857).
Repro Steps:
Import-Module PSDiagnostics -Alias @()
Get-Module PSDiagnostics | fl * #verify the exported functions are there
Get-Command -Module PSDiagnostics #No commands will be shown
Expected Results:
This should import all the functions, variables, and cmdlets, as no value was specified for those parameters. They should remain the default values.
If you just ran import-module, the equivalent parameter values (default values) would be * (for everything). The minute you specify one value, the remainder default to none.
Internal BugId: 3265
