question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get-PartnerCustomerAgreement not working

See original GitHub issue

When I call the cmdlet and let it prompt for customerID it fails telling me CustomerID doesn’t pass RegEx pattern match:

PS C:\WINDOWS\system32> Get-PartnerCustomerAgreement
cmdlet Get-PartnerCustomerAgreement at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
CustomerId: $customer.customerID
Get-PartnerCustomerAgreement : Cannot validate argument on parameter 'CustomerId'. The argument "$customer.customerID" does not match the "^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$" pattern. Supply 
an argument that matches "^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$" and try the command again.
At line:1 char:1
+ Get-PartnerCustomerAgreement
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-PartnerCustomerAgreement], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Store.PartnerCenter.PowerShell.Commands.GetPartnerCustomerAgreement

When I compare the customerID directly to the RegEx, I get a $true back:

PS C:\WINDOWS\system32> $customer.CustomerId -match "^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$"
True

When I pass the parameter in at call time, I get a generic exception error:

PS C:\WINDOWS\system32> Get-PartnerCustomerAgreement -CustomerId $customer.CustomerId
Get-PartnerCustomerAgreement : Exception of type 'Microsoft.Store.PartnerCenter.Exceptions.PartnerException' was thrown.
At line:1 char:1
+ Get-PartnerCustomerAgreement -CustomerId $customer.CustomerId
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-PartnerCustomerAgreement], PartnerException
    + FullyQualifiedErrorId : Microsoft.Store.PartnerCenter.Exceptions.PartnerException,Microsoft.Store.PartnerCenter.PowerShell.Commands.GetPartnerCustomerAgreement

Installed today:

PS C:\WINDOWS\system32> Get-Module PartnerCenter | FL


Name              : PartnerCenter
Path              : C:\Program Files\WindowsPowerShell\Modules\PartnerCenter\1.0.1808.2\PartnerCenter.psd1
Description       : Microsoft Partner Center - cmdlets for managing Partner Center resources.
ModuleType        : Manifest
Version           : 1.0.1808.2
NestedModules     : {Microsoft.Store.PartnerCenter.PowerShell}
ExportedFunctions : 
ExportedCmdlets   : {Add-PartnerCustomerCartLineItem, Add-PartnerCustomerUserRoleMember, Connect-PartnerCenter, Get-PartnerAgreementDetail...}
ExportedVariables : 
ExportedAliases   : 

Any help appreciated.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
cblackukcommented, Sep 6, 2018

@danabrash How are you obtaining the CustomerID Var? I do this and it works:

$CustomerID = Get-PartnerCustomer | select -first 1
Get-PartnerCustomerAgreement -CustomerId $CustomerID.CustomerId

I think I know what you are doing wrong. If you passing just the function and no params you cannot use vars:

Get-PartnerCustomerAgreement
cmdlet Get-PartnerCustomerAgreement at command pipeline position 1
Supply values for the following parameters:
CustomerId: $CustomerID.CustomerId
Get-PartnerCustomerAgreement : Cannot validate argument on parameter 'CustomerId'. The argument "$CustomerID.CustomerId" does not match the "^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$" pattern. Supply an argument that matches
"^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$" and try the command again.
At line:1 char:1
+ Get-PartnerCustomerAgreement
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-PartnerCustomerAgreement], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Store.PartnerCenter.PowerShell.Commands.GetPartnerCustomerAgreement

So either validate value of your var when you are doing it manually or pass param like I did above.

Because what is actually trying to mtach your regex is “$customer.customerID” string not the value of it.

This is not an issue and should be closed imho 😃 @isaiahwilliams

1reaction
danabrashcommented, Sep 18, 2018

Thanks @cblackuk, that was exactly perfect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to confirm that your customer has accepted the ...
Direct-bill partners can confirm new and existing customers' acceptance of the Microsoft Customer Agreement in Partner Center.
Read more >
Microsoft Customer Agreement – FAQs - Support : IngramCloud
It is the partner's responsibility to obtain customer acceptance of the agreement from a person inside the customer organization. What products ...
Read more >
What is the Microsoft Customer Agreement? - YouTube
The Microsoft Customer Agreement is a key recent development of ... the MCA to the old method 10:05 - How MCA affects Microsoft...
Read more >
Microsoft Customer Agreement (MCA)
One Microsoft agreement that all customers sign! What are the benefits? ... When does it start? ... Where to get additional information? Do...
Read more >
What is CSP? Microsoft Cloud Solution Program explained
Here's everything you need to know about Cloud Solution Provider (CSP) program if you purchase Microsoft software and cloud.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found