Okay,So i'm trying to use powershell to pull some information about some Sql Server Reportin Server reports.I've got my connection to the reporting servicehttp://technet.microsoft.com/en-us/library/reportservice2010.reportingservice2010.getitemparameters.aspxand i'm trying to use the "GetItemParamters" method.The code provided for VB, and other languages specifies sending the HistoryID to "Nothing" in VB.I'm using powershell, but I cannot fathom "Nothing" in Powershell.I've tried, $null, tried creating a variable then setting it=nothing..Powershell doesn't seem to be able to pass "Nothing" to a SOAP query, and $null is actually a variable of a type of string in powershell.$rs.GetItemParameters($report.path,$Null,$false,$PRVALUE,$PRCRED)Exception calling "GetItemParameters" with "5" argument(s): "The parameter value provided for 'snapshotID' does not match the parameter type. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ParameterTypeMismatchException: The parameter value provided for 'snapshotID' does not match the parameter type. ---> System.Exception: For more information about this error navigate to the report server on the local server machine, or enable remote errors"At line:1 char:1+ $rs.GetItemParameters($report.path,$Null,$false,$PRVALUE,$PRCRED)+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ( [], MethodInvocationException
4/29/2014 5:38:05 PM
try the workarounds herehttps://connect.microsoft.com/PowerShell/feedback/details/307821/it-isnt-possible-to-pass-null-as-null-into-a-net-method-that-has-a-parameter-of-type-string[Edited on April 29, 2014 at 7:44 PM. Reason : it's not on that link, but does passing [NullString]::Value work?]
4/29/2014 7:28:21 PM
I'll try it when i'm back at work...I got it working using invoke on a different method, but its still kinda frustrating. My new job kinda limits me to Powershell, so while i'm learning it its taking me a hell of a lot longer to do some tasks that took me minutes in VS.http://social.technet.microsoft.com/Forums/en-US/bb99577b-ab67-4c78-a240-efa641b4c161/powershell-using-null-for-object-properties-in-web-services?forum=ITCGis another interesting site on the problem..Currently i'm working on hitting the following servicesBigFix, SSRS, and possibly a few other systems, I'm hoping they all have SOAP interfaces.
4/29/2014 9:17:51 PM
use JScript, send to null[Edited on April 29, 2014 at 9:18 PM. Reason : nvm, just saw you have to use PowerShell
4/29/2014 9:18:26 PM
Im hoping at some point i can provide enough value that they open up the door to using some actual developer level tools. Right now there is a lot of fear i think because most of the staff still aren't strong in powershell, heck some have very little scripting and programming experience at all.There is a lot of hesitation about writing any code that another person cannot immidiatly go in behind you and instantly understand and understand. Commenting helps, but frankly it can only go so far if someone hasn't programmed in the last 15+ yearsThat being said, powershell isn't a bad skill to have, so I don't mind beefing up a little bit more on it. Its an improvement over VBScript for sure, but I didn't realize how comfortable I had become using VS.Access on the other hand... Dear god why can't they improve VBA jesus.
4/29/2014 11:56:16 PM
$nothing=[System.Management.Automation.Language.NullString]::Value$RS.GetItemParameters($myreport.$nothing,$null,$false,$nothing,$nothing)doesnt seem to work, nor does your suggestion...Screw PS.
5/1/2014 2:03:43 PM
$myreport.$nothingperiod vs comma?
5/1/2014 3:02:08 PM
frick stupid typo, ill double check that
5/1/2014 11:55:29 PM
You can edit and debug powershell with intellisense in VS2013 I think
5/2/2014 2:25:09 PM