LibrarySmo.ps1 Error when using Reporting Feature

Jul 8, 2010 at 3:13 PM

Hi

I am getting an error when executing the PSX job for reporting which is stating the LibrarySmo.ps1 is not a recognized cmdlet etc... , I have registered the modules successfully and correctly referenced in the job path.

When I run an SMO function such as get-SQLData manually it works perfectly thus SMO is available, your help would be much appreciated...

I have added the below error log

Server 2008 Standard X64 | SQL 2008 Enterprise X64

"The term 'C:\PSS\SQLServer\LibrarySmo.ps1' is not recognized as the name of a c
mdlet, function, script file, or operable program. Check the spelling of the na
me, or if a path was included, verify that the path is correct and try again.
At C:\PSS\SQLServer\run-SmoToCsvFile.ps1:22 char:2
+ . <<<<  $scriptRoot\LibrarySmo.ps1
    + CategoryInfo          : ObjectNotFound: (C:\PSS\SQLServer\LibrarySmo.ps1
   :String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
The term 'Get-SqlData' is not recognized as the name of a cmdlet, function, scr
ipt 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 C:\PSS\SQLServer\run-SmoToCsvFile.ps1:34 char:13
+  Get-SqlData <<<<  $SQLPSXServer $SQLPSXDb  "SELECT Server FROM dbo.SqlServer
 WHERE IsEnabled = 'true'" | foreach {$_.Server} | Test-SqlConn |
    + CategoryInfo          : ObjectNotFound: (Get-SqlData:String) [], Command
   NotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
The term 'C:\PSS\SQLServer\LibrarySmo.ps1' is not recognized as the name of a c
mdlet, function, script file, or operable program. Check the spelling of the na
me, or if a path was included, verify that the path is correct and try again.
At C:\PSS\SQLServer\Write-SmoCsvToDb.ps1:17 char:2
+ . <<<<  $scriptRoot\LibrarySmo.ps1
    + CategoryInfo          : ObjectNotFound: (C:\PSS\SQLServer\LibrarySmo.ps1
   :String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException"
 

 

Coordinator
Jul 8, 2010 at 5:30 PM

The SQL job creation script needs to be updated for PowerShell V2. What version of SQLPSX are you using?

Jul 9, 2010 at 8:16 AM

Hi There

THe PSX version is 2.2.2.

Thanks

Don

Coordinator
Jul 10, 2010 at 10:57 PM
Looks like I hadn't updated the script and SQL job for PowerShell version 2.0 modules. I created a patch with readme file instructions. I'll get this fixed permanently in future release. For now you can grab the patch here: http://sqlpsx.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=131723 Let me know if you have any problems.
Jul 13, 2010 at 8:49 AM

Hi

 

Thanks a mill for the patch it is working great now!!

 

Don