This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PowerShell standards and documentation cleanup (#61)
* First pass of the script analyzer fixes * Fixed: Plural PowerShell Nouns Added non-plural version of each cmdlet that used a plural name. Updated documentation to match. * Documentation Updates and cmdlets Updated documentation and added non-plural versions of the existing cmdlets. * Added warning text to deprecated cmdlets Added warning text to deprecated cmdlets. Also added some details to some of the cmdlet help files about authentication and specific parameters.
- Loading branch information
1 parent
ebc0713
commit e768c6e
Showing
93 changed files
with
1,124 additions
and
655 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,32 +11,32 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope | |
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or | ||
contact [[email protected]](mailto:[email protected]) with any additional questions or comments. | ||
|
||
- [Code of Conduct](#coc) | ||
- [Issues and Bugs](#issue) | ||
- [Feature Requests](#feature) | ||
- [Submission Guidelines](#submit) | ||
- [Code of Conduct](#code-of-conduct) | ||
- [Issues and Bugs](#finding-issues) | ||
- [Feature Requests](#requesting-features) | ||
- [Submission Guidelines](#submission-guidelines) | ||
|
||
## <a name="coc"></a> Code of Conduct | ||
## Code of Conduct | ||
|
||
Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
|
||
## <a name="issue"></a> Found an Issue? | ||
## Finding Issues | ||
|
||
If you find a bug in the source code or a mistake in the documentation, you can help us by | ||
[submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can | ||
[submit a Pull Request](#submit-pr) with a fix. | ||
[submitting an issue](#submitting-an-issue) to the GitHub Repository. Even better, you can | ||
[submit a Pull Request](#submitting-a-pull-request) with a fix. | ||
|
||
## <a name="feature"></a> Want a Feature? | ||
## Requesting Features | ||
|
||
You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub | ||
You can *request* a new feature by [submitting an issue](#submitting-an-issue) to the GitHub | ||
Repository. If you would like to *implement* a new feature, please submit an issue with | ||
a proposal for your work first, to be sure that we can use it. | ||
|
||
**Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). | ||
**Small Features** can be crafted and directly [submitted as a Pull Request](#submitting-a-pull-request). | ||
|
||
## <a name="submit"></a> Submission Guidelines | ||
## Submission Guidelines | ||
|
||
### <a name="submit-issue"></a> Submitting an Issue | ||
### Submitting an Issue | ||
|
||
Before you submit an issue, search the archive, maybe your question was already answered. | ||
|
||
|
@@ -54,13 +54,13 @@ chances of your issue being dealt with quickly: | |
- **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be | ||
causing the problem (line of code or commit) | ||
|
||
You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/Microsoft/PartnerCenterPowerShellModule/issues/new. | ||
You can file new issues by providing the above information at the [corresponding repository's issues link](https://github.com/Microsoft/PartnerCenterPowerShellModule/issues/new). | ||
|
||
### <a name="submit-pr"></a> Submitting a Pull Request (PR) | ||
### Submitting a Pull Request | ||
|
||
Before you submit your Pull Request (PR) consider the following guidelines: | ||
|
||
- Search the repository (https://github.com/Microsoft/PartnerCenterPowerShellModule/pulls) for an open or closed PR | ||
- [Search the repository](https://github.com/Microsoft/PartnerCenterPowerShellModule/pulls) for an open or closed PR | ||
that relates to your submission. You don't want to duplicate effort. | ||
|
||
- Make your changes in a new git fork: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# Partner Center PowerShell Module (preview) # | ||
# Add-PCAuthentication # | ||
|
||
## Add-PCAuthentication ## | ||
## Set a global token for the script session - user authentication ## | ||
|
||
**Set a global token for the script session - user authentication** | ||
```powershell | ||
$cred = Get-Credential | ||
Add-PCAuthentication -cspappID '<native app id GUID>' -cspDomain '<csp partner domain>' -credential $cred | ||
``` | ||
|
||
$credential = Get-Credential | ||
|
||
Add-PCAuthentication -cspappID '<native app id GUID>' -cspDomain '<csp partner domain>' -credential $credential | ||
|
||
**Set a global token for the script session - app authentication** | ||
## Set a global token for the script session - app authentication ## | ||
|
||
```powershell | ||
$clientSecret = '<key code secret>' | ||
$clientSecretSecure = $clientSecret | ConvertTo-SecureString -AsPlainText -Force | ||
|
||
Add-PCAuthentication -cspappID '<web app id GUID>' -cspDomain '<csp partner domain>' -cspClientSecret $clientSecretSecure | ||
$clientSecretSecure = $clientSecret | ConvertTo-SecureString -AsPlainText -Force | ||
Add-PCAuthentication -cspappID '<web app id GUID>' -cspDomain '<csp partner domain>' -cspClientSecret $clientSecretSecure | ||
``` | ||
|
||
You can obtain the Web App ID and the Client Secret from either Partner Center UI or Azure Active Directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
# Partner Center PowerShell Module (preview) # | ||
# Add-PCCustomerRoleMember # | ||
|
||
## Add-PCCustomerRoleMember ## | ||
|
||
**Get a customer** | ||
## Specify a customer ## | ||
|
||
```powershell | ||
$customer = Get-PCCustomer -tenantid '<tenant id GUID>' | ||
``` | ||
|
||
**Get a role** | ||
## Get a role ## | ||
|
||
```powershell | ||
$role = Get-PCCustomerRole -tenantid $customer.id | Where-Object name -Contains '<role name>' | ||
``` | ||
|
||
**Get a User** | ||
## Get a User ## | ||
|
||
```powershell | ||
$user = Get-PCCustomerUser -tenantid $customer.id -userid '<user id guid>' | ||
``` | ||
|
||
**Add a User to a Role** | ||
## Add a User to a Role ## | ||
|
||
```powershell | ||
$customerRoleMember = [DirectoryRoleMember]::new() | ||
$customerRoleMember.id = $user.id | ||
Add-PCCustomerRoleMember -tenantid $customer.id -roleid $role.id -customerrolemember $customerRoleMember | ||
|
||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# Partner Center PowerShell Module (preview) # | ||
|
||
## Get-PCAddressRulesByMarket ## | ||
|
||
**Get all address rules for countryid** | ||
|
||
Get-PCAddressRulesByMarket -countryid '<country two digits id>' | ||
# Get-PCAddressRulesByMarket # | ||
|
||
## Get all address rules for countryid ## | ||
|
||
```powershell | ||
Get-PCAddressRulesByMarket -countryid '<country two digits id>' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Get-PCAuditRecord # | ||
|
||
## Get audit logs starting from a specific date ## | ||
|
||
```powershell | ||
Get-PCAuditRecord -startDate '2017-04-12' | ||
``` | ||
|
||
## Get audit logs between two dates ## | ||
|
||
```powershell | ||
Gett-PCAuditRecord -startDate '2017-04-12' -endDate '2017-04-13' | ||
``` | ||
|
||
## Get audit logs of a specific operationType between two dates ## | ||
|
||
```powershell | ||
Get-PCAuditRecord -startDate '2017-04-12' -endDate '2017-04-13' | ? operationType -EQ 'delete_customer_user' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
# Partner Center PowerShell Module (preview) # | ||
# Get-PCAuditRecords # | ||
|
||
## Get-PCAuditRecords ## | ||
## Deprecated: Please use Get-PCAuditRecord ## | ||
|
||
**Get audit logs starting from a specific date** | ||
## Get audit logs starting from a specific date ## | ||
|
||
```powershell | ||
Get-PCAuditRecords -startDate '2017-04-12' | ||
``` | ||
|
||
**Get audit logs between two dates** | ||
## Get audit logs between two dates ## | ||
|
||
```powershell | ||
Gett-PCAuditRecords -startDate '2017-04-12' -endDate '2017-04-13' | ||
``` | ||
|
||
**Get audit logs of a specific operationType between two dates** | ||
## Get audit logs of a specific operationType between two dates ## | ||
|
||
```powershell | ||
Get-PCAuditRecords -startDate '2017-04-12' -endDate '2017-04-13' | ? operationType -EQ 'delete_customer_user' | ||
|
||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
# Partner Center PowerShell Module (preview) # | ||
# Get-PCAzureRateCard # | ||
|
||
## Get-PCAzureRateCard ## | ||
## Get Azure rate card (meters) for default context ## | ||
|
||
**Get azure rate card (meters) for default context** | ||
```powershell | ||
Get-PCAzureRateCard | ||
``` | ||
|
||
Get-PCAzureRateCard | ||
- **currency** Optional three letter ISO code for the currency in which the resource rates will be provided (e.g. "EUR"). The default is the currency associated with the market in the partner profile. | ||
- **region** Optional two-letter ISO country/region code that indicates the market where the offer is purchased (e.g. "FR"). The default is the country/region code set in the partner profile. | ||
|
||
**Get azure rate card for specific currency and region** | ||
## Get Azure rate card for specific currency and region ## | ||
|
||
```powershell | ||
Get-PCAzureRateCard -currency '<three digits currency>' -region '<two digits region code>' | ||
|
||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# Partner Center PowerShell Module (preview) # | ||
# Get-PCBillingProfile # | ||
|
||
## Get-PCBillingProfile ## | ||
|
||
**Get Partner Billing Profile** | ||
## Get Partner Billing Profile ## | ||
|
||
```powershell | ||
Get-PCBillingProfile | ||
|
||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
# Partner Center PowerShell Module (preview) # | ||
# Get-PCCustomer # | ||
|
||
## Get-PCCustomer ## | ||
|
||
|
||
**Get all customers** | ||
## Get all customers ## | ||
|
||
```powershell | ||
Get-PCCustomer -all | ||
``` | ||
|
||
**Get a customer by ID** | ||
## Get a customer by ID ## | ||
|
||
```powershell | ||
$customer = Get-PCCustomer -tenantid '<tenant id GUID>' | ||
``` | ||
|
||
**Get customers by company name** | ||
## Get customers by company name ## | ||
|
||
```powershell | ||
Get-PCCustomer -startswith '<company name>' | ||
|
||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# Partner Center PowerShell Module (preview) # | ||
# Get-PCCustomerBillingProfile # | ||
|
||
## Get-PCCustomerBillingProfile ## | ||
|
||
**Get a customer** | ||
## Get a customer ## | ||
|
||
```powershell | ||
$customer = Get-PCCustomer -tenantid '<tenant id GUID>' | ||
``` | ||
|
||
**Get customer Billing Profile** | ||
## Get customer billing profile ## | ||
|
||
```powershell | ||
Get-PCCustomerBillingProfile -tenantid $customer.id | ||
|
||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# Partner Center PowerShell Module (preview) # | ||
# Get-PCCustomerCompanyProfile # | ||
|
||
## Get-PCCustomerCompanyProfile ## | ||
|
||
**Get a customer** | ||
## Specify a customer ## | ||
|
||
```powershell | ||
$customer = Get-PCCustomer -tenantid '<tenant id GUID>' | ||
``` | ||
|
||
**Get customer Company Profile** | ||
## Get customer company profile ## | ||
|
||
```powershell | ||
Get-PCCustomerCompanyProfile -tenantid $customer.id | ||
|
||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Get-PCCustomerLicenseDeployment # | ||
|
||
This cmdlet requires App+User authentication | ||
|
||
## Specify a customer ## | ||
|
||
```powershell | ||
$customer = Get-PCCustomer -tenantid '<tenant id GUID>' | ||
``` | ||
|
||
## Get customer licenses deployment information ## | ||
|
||
```powershell | ||
Get-PCCustomerLicenseDeployment -tenantid $customer.id | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Get-PCCustomerLicenseUsage # | ||
|
||
This cmdlet requires App+User authentication | ||
|
||
## Specify a customer ## | ||
|
||
```powershell | ||
$customer = Get-PCCustomer -tenantid '<tenant id GUID>' | ||
``` | ||
|
||
## Get customer license usage information ## | ||
|
||
```powershell | ||
Get-PCCustomerLicenseUsage -tenantid $customer.id | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
# Partner Center PowerShell Module (preview) # | ||
# Get-PCCustomerLicensesDeployment # | ||
|
||
## Get-PCCustomerLicensesDeployment ## | ||
## Deprecated: Use Get-PCCustomerLicenseDeployment instead ## | ||
|
||
**Get a customer** | ||
## Specify a customer ## | ||
|
||
```powershell | ||
$customer = Get-PCCustomer -tenantid '<tenant id GUID>' | ||
``` | ||
|
||
**Get customer licenses deployment information** | ||
## Get customer licenses deployment information ## | ||
|
||
```powershell | ||
Get-PCCustomerLicensesDeployment -tenantid $customer.id | ||
|
||
|
||
``` |
Oops, something went wrong.