Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
PowerShell standards and documentation cleanup (#61)
Browse files Browse the repository at this point in the history
* 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
joelst authored and idwilliams-2 committed May 23, 2018
1 parent ebc0713 commit e768c6e
Show file tree
Hide file tree
Showing 93 changed files with 1,124 additions and 655 deletions.
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# Partner Center PowerShell Module Changelog

## 0.9.0.20 (2018-05-14)
## 0.9.0.21 (2018-05-22)

### Features

* No new features were added
* Removed telemetry functions
* Added non-plural cmdlets names to comply with PowerShell standards
* Get-PCAuditRecord
* Get-PCCustomerLicenseDeployment
* Get-PCCustomerLicenseUsage
* Get-PCCustomerRelationship
* Get-PCIndirectReseller
* Get-PCLicenseUsage
* Get-PCLicenseDeployment
* Get-PCManagedSerice
* Get-PCResellerCustomer
* Get-PCSRTopic
* Get-PCSubscribedSKU

### Bug Fixes

* Addressed an issue with the New-PCCustomer cmdlet that was preventing customers currently.
* Addressed an issue where Get-PCOfferCategoriesByMarket did not require the countryId, however the API does require this.

### Breaking Changes

Expand Down
32 changes: 16 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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:
Expand Down
22 changes: 11 additions & 11 deletions CmdletHelp/Add-PCAuthentication.md
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
22 changes: 13 additions & 9 deletions CmdletHelp/Add-PCCustomerRoleMember.md
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


```
12 changes: 5 additions & 7 deletions CmdletHelp/Get-PCAddressRulesByMarket.md
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>'
```
19 changes: 19 additions & 0 deletions CmdletHelp/Get-PCAuditRecord.md
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'
```
18 changes: 11 additions & 7 deletions CmdletHelp/Get-PCAuditRecords.md
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'


```
17 changes: 10 additions & 7 deletions CmdletHelp/Get-PCAzureRateCard.md
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>'


```
10 changes: 4 additions & 6 deletions CmdletHelp/Get-PCBillingProfile.md
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


```
19 changes: 10 additions & 9 deletions CmdletHelp/Get-PCCustomer.md
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>'


```
14 changes: 7 additions & 7 deletions CmdletHelp/Get-PCCustomerBillingProfile.md
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


```
14 changes: 7 additions & 7 deletions CmdletHelp/Get-PCCustomerCompanyProfile.md
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


```
15 changes: 15 additions & 0 deletions CmdletHelp/Get-PCCustomerLicenseDeployment.md
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
```
15 changes: 15 additions & 0 deletions CmdletHelp/Get-PCCustomerLicenseUsage.md
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
```
14 changes: 8 additions & 6 deletions CmdletHelp/Get-PCCustomerLicensesDeployment.md
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


```
Loading

0 comments on commit e768c6e

Please sign in to comment.