# Import-Module -FullyQualifiedName not working as expected?

**URL:** <https://forums.powershell.org/t/import-module-fullyqualifiedname-not-working-as-expected/9683>\
**Category:** PowerShell Help\
**Created:** [November 11, 2017, 6:38am UTC](https://forums.powershell.org/t/import-module-fullyqualifiedname-not-working-as-expected/9683 "2017-11-11T06:38:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![majst32](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@majst32](https://forums.powershell.org/u/majst32)\
**Post date:** [November 11, 2017, 6:38am UTC](https://forums.powershell.org/t/import-module-fullyqualifiedname-not-working-as-expected/9683/1 "2017-11-11T06:38:19Z")

</div>

I have two versions of PSScriptAnalyzer in C:\Program Files\WindowsPowerShell\Modules - version 1.13.0 and 1.16.0.  
If I use

```
import-module -requiredversion 1.13.0
```
 and then do get-command -module PSScriptAnalyzer I see that 1.13.0 is loaded. However, if I remove the module and repeat the import using -FullyQualifiedName 
```
import-module -FullyQualifiedName @{ModuleName = ‘PSScriptAnalyzer’;ModuleVersion = ‘1.13.0’}
```
 and repeat the get-command -module PSScriptAnalyzer, I see the commands from 1.16.0 instead. Any ideas? PEBKAC error, or bug? (I’ve already done internet searches and can’t find any reported bugs.) TIA!

---

<div class="post-metadata">

**Author:** ![majst32](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@majst32](https://forums.powershell.org/u/majst32)\
**Post date:** [November 11, 2017, 6:43am UTC](https://forums.powershell.org/t/import-module-fullyqualifiedname-not-working-as-expected/9683/2 "2017-11-11T06:43:55Z")

</div>

I did notice that instead of using -ModuleVersion, I can use -RequiredVersion and get the expected results. Still would like to know why -ModuleVersion doesn’t work though!

---

<div class="post-metadata">

**Author:** ![richard-siddaway](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@richard-siddaway](https://forums.powershell.org/u/richard-siddaway)\
**Post date:** [November 11, 2017, 6:54am UTC](https://forums.powershell.org/t/import-module-fullyqualifiedname-not-working-as-expected/9683/3 "2017-11-11T06:54:38Z")

</div>

I’ve duplicated the behaviour using the Pester module

Import-Module -FullyQualifiedName @{Modulename = ‘Pester’; RequiredVersion = ‘4.0.2’}

will load the correct version

---

<div class="post-metadata">

**Author:** ![majst32](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@majst32](https://forums.powershell.org/u/majst32)\
**Post date:** [November 11, 2017, 7:07am UTC](https://forums.powershell.org/t/import-module-fullyqualifiedname-not-working-as-expected/9683/4 "2017-11-11T07:07:32Z")

</div>

Suddenly this explains a lot of “unexpected” behavior in some of my DSC configs as well where we’re using -ModuleVersion.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:37pm UTC](https://forums.powershell.org/t/import-module-fullyqualifiedname-not-working-as-expected/9683/5 "2024-05-16T20:37:14Z")

</div>

Closed on May 16, 2024, 8:37pm UTC


