Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-MsrcCvrfDocument : Cannot retrieve the dynamic parameters for the cmdlet. #9

Open
vrdse opened this issue Apr 27, 2017 · 3 comments
Assignees
Labels

Comments

@vrdse
Copy link

vrdse commented Apr 27, 2017

On Windows 7 with PowerShell 3 I get the following error:

Get-MsrcCvrfDocument "2016-Aug" -Verbose

Get-MsrcCvrfDocument : Cannot retrieve the dynamic parameters for the cmdlet. Unable to get online the list of CVRF ID

Presumably that is because Invoke-RestMethod doesn't accept the "Accept" header.

Invoke-RestMethod -Uri 'https://api.msrc.microsoft.com/Updates?api-Version=2016-08-01' -Headers @{ 'Api-Key' = 'x' 'Accept' = 'application/json' }

Invoke-RestMethod : The 'Accept' header must be modified using the appropriate property or method.
Parameter name: name

Edit:
On Windows 2012 R2 with PowerShell 5.0 i get the same error for Get-MsrcCvrfDocument but Invoke-RestMethod is working. Please note that I'm behind a proxy and set the proxy configuration as $PSDefaultParameterValues (see #5 ). Might also be related to that.

@vrdse vrdse changed the title Not working on PSVersion 3.0 Get-MsrcCvrfDocument : Cannot retrieve the dynamic parameters for the cmdlet. Apr 27, 2017
@Xeleema
Copy link

Xeleema commented May 11, 2017

I am experiencing the same issue in 1.6.6.
However, when Get-CVRFID is sourced and ran directly, it works (this confirms the problem in Get-MsrcCvrfDocument, however despite my efforts I am unable to narrow-down exactly what Get-MsrcCvrfDocument is doing wrong before it calls Get-CVRFID).

Reproduction steps below, along w/ error analysis and information on my platform.

PS C:\>
PS C:\>
PS C:\> ##
PS C:\> ## TEST BLOCK (Base) - C:\CVRF\MsrcSecurityUpdates
PS C:\> ##
PS C:\>
PS C:\> $error.clear()
PS C:\>
PS C:\> $PSDefaultParameterValues += @{'*:ProxyUseDefaultCredentials'=$true;'*:Proxy'='http://MY_PROXY.DOMAIN.com:PORT/'} ## redacted from comment
PS C:\>
PS C:\> Import-Module C:\CVRF\MsrcSecurityUpdates
PS C:\>
PS C:\> $MyAPIKey = "MY_API_KEY" ## redacted from comment
PS C:\> Set-MSRCApiKey -ApiKey $MyAPIKey
PS C:\>
PS C:\> Get-MsrcCvrfDocument -ID "2017-May" -Verbose
Get-MsrcCvrfDocument : Cannot retrieve the dynamic parameters for the cmdlet. Unable to get online the list of CVRF ID
At line:1 char:1
+ Get-MsrcCvrfDocument -ID "2017-May" -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-MsrcCvrfDocument], ParameterBindingException
    + FullyQualifiedErrorId : GetDynamicParametersException,Get-MsrcCvrfDocument
PS C:\>
PS C:\> ##
PS C:\> ## TEST BLOCK (end)
PS C:\> ##
PS C:\>

Error review;

PS C:\> $error[0]
Get-MsrcCvrfDocument : Cannot retrieve the dynamic parameters for the cmdlet. Unable to get online the list of CVRF ID
At line:1 char:1
+ Get-MsrcCvrfDocument -ID "2017-May" -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-MsrcCvrfDocument], ParameterBindingException
    + FullyQualifiedErrorId : GetDynamicParametersException,Get-MsrcCvrfDocument

PS C:\>


PS C:\>
PS C:\> $error[1]
Unable to get online the list of CVRF ID
At C:\CVRF\MsrcSecurityUpdates\Public\Get-MsrcCvrfDocument.ps1:54 char:13
+             Throw 'Unable to get online the list of CVRF ID'
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Unable to get online the list of CVRF ID:String) [], RuntimeException
    + FullyQualifiedErrorId : Unable to get online the list of CVRF ID

PS C:\>



PS C:\> $Error[2]
Invoke-RestMethod :

Access Denied (authentication_failed)
##
## redacted full error from proxy text.
##
At C:\CVRF\MsrcSecurityUpdates\Private\Get-CVRFID.ps1:46 char:15
+             ((Invoke-RestMethod @RestMethod).Value).ID
+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
PS C:\>

FYI: Platform is Windows Server 2012 R2 (w/ "Update 1" and all other security-related patches applied).

PS C:\> $PSversionTable
Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.34014
BuildVersion                   6.3.9600.17400
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

NOTE: When I source Private\Get-CVRFID.PS1 and run it manually (done from the same PowerShell session that the test-block above was executed in), it works just fine;

PS C:\> ##
PS C:\> ## Failure Testing
PS C:\> ##
PS C:\>
PS C:\> . C:\CVRF\MsrcSecurityUpdates\Private\Get-CVRFID.ps1
PS C:\> Get-CVRFID -ID "2017-May"

ID                 : 2017-May
Alias              : 2017-May
DocumentTitle      : May 2017 Security Updates
Severity           :
InitialReleaseDate : 2017-05-09T07:00:00Z
CurrentReleaseDate : 2017-05-09T07:00:00Z
CvrfUrl            : https://api.msrc.microsoft.com/cvrf/2017-May?api-Version=2016-08-01

PS C:\>
PS C:\> ##
PS C:\> ## Failure Testing (end)
PS C:\> ##

@Xeleema
Copy link

Xeleema commented May 11, 2017

To clarify, my organization is still unable to utilize the API. This is a concern, since the BulletinSearch.xlsx has not been updated since March (we use that resource to get the patch 'Title' names. See Issue #2 )

@EnviableOne
Copy link

Issue still persists in 1.7.2 with PS 5.0.1

Get-MsrcCvrfDocument : Cannot retrieve the dynamic parameters for the cmdlet.
Unable to get online the list of CVRF ID
At C:\msrc\GetMSRC.ps1:8 char:1

  • Get-MsrcCvrfDocument -ID $timeperiod | Get-MsrcVulnerabilityReportHtm ...
  •   + CategoryInfo          : InvalidArgument: (:) [Get-MsrcCvrfDocument], ParameterBindingException
      + FullyQualifiedErrorId : GetDynamicParametersException,Get-MsrcCvrfDocument
    

stmoor pushed a commit that referenced this issue Feb 17, 2022
Merge changes from original repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants