Get-PartnerCustomerAgreement not working
See original GitHub issueWhen 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:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@danabrash How are you obtaining the CustomerID Var? I do this and it works:
I think I know what you are doing wrong. If you passing just the function and no params you cannot use vars:
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
Thanks @cblackuk, that was exactly perfect.