# SQLReporting.psm1

**URL:** <https://forums.powershell.org/t/sqlreporting-psm1/760>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/sqlreporting-psm1/760 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/sqlreporting-psm1/760/1 "2011-12-31T18:30:00Z")

</div>

by fan4nyr2003 at 2013-03-21 13:53:22

> Hi… I am a newbie and trying your reporting ebook "Making Historical and Trend Reports in PowerShell" and following every step I have run into an issue. When importing the module I get the below error. As you can see the SQLReporting.psm1 file is in the right location as specified in the ebook, but the error is related to something within this file. Is there anyway you can help?  
>   
> PS C:\Windows\system32\> Import-Module SQLReporting  
> You must provide a value expression on the right-hand side of the ‘-’ operator.  
> At C:\Users\mrichter\Documents\WindowsPowerShell\Modules\SQLReporting\SQLReporting.psm1:145 char:28  
> + if ($property - \<\<\<\< in ‘@(‘name’,‘computername’,‘collected’)’) {  
> + CategoryInfo : ParserError: (🙂 , ParentContainsErrorRecordException  
> + FullyQualifiedErrorId : ExpectedValueExpression  
>   
> Import-Module : The specified module ‘SQLReporting’ was not loaded because no valid module file was found in any module  
> directory.  
> At line:1 char:14  
> + Import-Module \<\<\<\< SQLReporting  
> + CategoryInfo : ResourceUnavailable: (SQLReporting:String) [Import-Module], FileNotFoundException  
> + FullyQualifiedErrorId : Modules\_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand  
>   
>   
> Thanks

by poshoholic at 2013-03-21 14:07:31

> Make sure you don’t have any spaces between the "-" and "in" for the "-in" operator.

by poshoholic at 2013-03-21 14:08:58

> Also, further along that line, it looks like you put quotes around the array enclosure. The line should look like this:  
> `if ($property -in @('name','computername','collected')) {`

by fan4nyr2003 at 2013-03-21 14:17:40

> I apologize for posting my attempt on fixing this code (and not sure if a fix is required) but this is what the code looks like when downloaded from this site  
>   
> ` if ($property -in @(‘name’,‘computername’,‘collected’)) { $indexes += $property }`  
>   
> and here is the error again   
>   
> **PS C:\Windows\system32\> Import-Module SQLReporting  
> You must provide a value expression on the right-hand side of the ‘-’ operator.  
> At C:\Users\mrichter\Documents\WindowsPowerShell\Modules\SQLReporting\SQLReporting.psm1:137 char:28  
> + if ($property - \<\<\<\< in @(‘name’,‘computername’,‘collected’)) {  
> + CategoryInfo : ParserError: (🙂 , ParentContainsErrorRecordException  
> + FullyQualifiedErrorId : ExpectedValueExpression**  
>   
> **Import-Module : The specified module ‘SQLReporting’ was not loaded because no valid module file was found in any module  
> directory.  
> At line:1 char:14  
> + Import-Module \<\<\<\< SQLReporting  
> + CategoryInfo : ResourceUnavailable: (SQLReporting:String) [Import-Module], FileNotFoundException  
> + FullyQualifiedErrorId : Modules\_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand**

by poshoholic at 2013-03-21 14:22:45

> Ok, I see the real problem now. You’re using PowerShell 2.0. That module requires PowerShell 3.0.

---

<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:58pm UTC](https://forums.powershell.org/t/sqlreporting-psm1/760/2 "2024-05-16T20:58:23Z")

</div>

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


