Skip to content

Commit e703e48

Browse files
authored
Merge pull request #8 from cloudyspells/feature/issue7
Updates to internal help
2 parents 99cb741 + 046c2d2 commit e703e48

8 files changed

Lines changed: 134 additions & 45 deletions

docs/ConvertFrom-AzureRegion.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: PSWattTime-help.xml
33
Module Name: PSWattTime
4-
online version:
4+
online version: https://github.com/cloudyspells/PSWattTime/blob/main/docs/ConvertFrom-AzureRegion.md
55
schema: 2.0.0
66
---
77

@@ -67,8 +67,14 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
6767
6868
### a string containing the WattTime ba for the given Azure Region
6969
## NOTES
70-
A ba is WattTime's term for a balancing authority.
71-
A balancing authority is a regional entity that is responsible for maintaining the balance between supply and demand of electricity in a given region.
72-
For more information, see https://www.watttime.org/faq
70+
- A ba is WattTime's term for a balancing authority. A balancing authority is a regional entity that is responsible for maintaining the balance between supply and demand of electricity in a given region. For more information, see https://www.watttime.org/faq
71+
- This command, like the module, requires you to be connected to Azure via Connect-AzAccount
7372
7473
## RELATED LINKS
74+
75+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/ConvertFrom-AzureRegion.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/ConvertFrom-AzureRegion.md)
76+
77+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md)
78+
79+
[https://www.watttime.org/api-documentation/#determine-grid-region](https://www.watttime.org/api-documentation/#determine-grid-region)
80+

docs/Get-AzureRegionWithLowestWattTime.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: PSWattTime-help.xml
33
Module Name: PSWattTime
4-
online version:
4+
online version: https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-AzureRegionWithLowestWattTime.md
55
schema: 2.0.0
66
---
77

@@ -17,7 +17,7 @@ Get-AzureRegionWithLowestWattTime [-Regions] <String[]> [-AuthToken] <String> [<
1717
```
1818

1919
## DESCRIPTION
20-
Get the current WattTime index for a given Azure Region
20+
Get the Azure region with the lowest wattTime index from a given set of regions
2121

2222
## EXAMPLES
2323

@@ -44,7 +44,7 @@ Accept wildcard characters: False
4444
```
4545
4646
### -AuthToken
47-
The authentication token to use for the request
47+
The WattTime API authentication token to use for the request
4848
4949
```yaml
5050
Type: String
@@ -66,9 +66,15 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
6666
## OUTPUTS
6767
6868
### System.Management.Automation.PSObject containing the following properties:
69-
### ba: The WattTime ba for the given Azure Region
70-
### percent: The current WattTime index for the given Azure Region
71-
### region: The Azure Region for which the WattTime index was retrieved
69+
### - ba: The WattTime ba for the given Azure Region
70+
### - percent: The current WattTime index for the given Azure Region
71+
### - region: The Azure Region for which the WattTime index was retrieved
7272
## NOTES
73+
This command, like the module, requires you to be connected to Azure via Connect-AzAccount
7374
7475
## RELATED LINKS
76+
77+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-AzureRegionWithLowestWattTime.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-AzureRegionWithLowestWattTime.md)
78+
79+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md)
80+

docs/Get-WattTime.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: PSWattTime-help.xml
33
Module Name: PSWattTime
4-
online version:
4+
online version: https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTime.md
55
schema: 2.0.0
66
---
77

@@ -71,3 +71,10 @@ A balancing authority is a regional entity that is responsible for maintaining t
7171
For more information, see https://www.watttime.org/faq
7272
7373
## RELATED LINKS
74+
75+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTime.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTime.md)
76+
77+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md)
78+
79+
[https://www.watttime.org/api-documentation/#real-time-emissions-index](https://www.watttime.org/api-documentation/#real-time-emissions-index)
80+

docs/Get-WattTimeAuthToken.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: PSWattTime-help.xml
33
Module Name: PSWattTime
4-
online version:
4+
online version: https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md
55
schema: 2.0.0
66
---
77

@@ -70,3 +70,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
7070
This token should be used by the -AuthToken parameter of the other functions in this module
7171
7272
## RELATED LINKS
73+
74+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md)
75+
76+
[https://www.watttime.org/api-documentation/#login-amp-obtain-token](https://www.watttime.org/api-documentation/#login-amp-obtain-token)
77+

docs/Get-WattTimeForAzureRegion.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: PSWattTime-help.xml
33
Module Name: PSWattTime
4-
online version:
4+
online version: https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeForAzureRegion.md
55
schema: 2.0.0
66
---
77

@@ -44,7 +44,7 @@ Accept wildcard characters: False
4444
```
4545
4646
### -AuthToken
47-
The authentication token to use for the request
47+
The WattTime API authentication token to use for the request
4848
4949
```yaml
5050
Type: String
@@ -66,9 +66,17 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
6666
## OUTPUTS
6767
6868
### System.Management.Automation.PSObject containing the following properties:
69-
### ba: The WattTime ba for the given Azure Region
70-
### percent: The current WattTime index for the given Azure Region
71-
### region: The Azure Region for which the WattTime index was retrieved
69+
### - ba: The WattTime ba for the given Azure Region
70+
### - percent: The current WattTime index for the given Azure Region
71+
### - region: The Azure Region for which the WattTime index was retrieved
7272
## NOTES
73+
This command, like the module, requires you to be connected to Azure via Connect-AzAccount
7374
7475
## RELATED LINKS
76+
77+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeForAzureRegion.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeForAzureRegion.md)
78+
79+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTime.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTime.md)
80+
81+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md)
82+

docs/New-WattTimeAccount.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
external help file: PSWattTime-help.xml
33
Module Name: PSWattTime
4-
online version:
4+
online version: https://github.com/cloudyspells/PSWattTime/blob/main/docs/New-WattTimeAccount.md
55
schema: 2.0.0
66
---
77

88
# New-WattTimeAccount
99

1010
## SYNOPSIS
11-
Create a new WattTime account
11+
Create a new WattTime API account
1212

1313
## SYNTAX
1414

@@ -18,8 +18,8 @@ New-WattTimeAccount [-Username] <String> [-Password] <String> [-Email] <String>
1818
```
1919

2020
## DESCRIPTION
21-
Creates a new PSWattTime account with the specified username,
22-
password, email and organization
21+
Creates a new WattTime API account with the specified username,
22+
password, email and organization on watttime.org
2323

2424
## EXAMPLES
2525

@@ -98,10 +98,15 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
9898
## OUTPUTS
9999
100100
### System.Management.Automation.PSObject containing the following properties:
101-
### username: The username for the new account
102-
### email: The email address for the new account
103-
### org: The organization for the new account
104-
### token: The authentication token for the new account
101+
### - user: The username for the new account
102+
### - ok: The response for user creation
105103
## NOTES
104+
You can use an email address only once at WattTime.
105+
Registering multiple accounts will fail with an error.
106106
107107
## RELATED LINKS
108+
109+
[https://github.com/cloudyspells/PSWattTime/blob/main/docs/New-WattTimeAccount.md](https://github.com/cloudyspells/PSWattTime/blob/main/docs/New-WattTimeAccount.md)
110+
111+
[https://www.watttime.org/api-documentation/#register-new-user](https://www.watttime.org/api-documentation/#register-new-user)
112+

src/PSWattTime/PSWattTime.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'PSWattTime.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.0.2.0'
15+
ModuleVersion = '1.0.3.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -114,7 +114,7 @@ PrivateData = @{
114114
# IconUri = ''
115115

116116
# ReleaseNotes of this module
117-
ReleaseNotes = 'Added New-WattTimeAccount function for registering a new WattTime account'
117+
ReleaseNotes = 'Updates to documentation and PowerShell internal help'
118118

119119
# Prerelease string of this module
120120
# Prerelease = ''
@@ -130,7 +130,7 @@ PrivateData = @{
130130
} # End of PrivateData hashtable
131131

132132
# HelpInfo URI of this module
133-
HelpInfoURI = ''
133+
HelpInfoURI = 'https://github.com/cloudyspells/PSWattTime#readme'
134134

135135
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
136136
# DefaultCommandPrefix = ''

src/PSWattTime/PSWattTime.psm1

Lines changed: 69 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ $script:azLocations = Get-AzLocation
2121
2222
.OUTPUTS
2323
a string containing the authentication token for the WattTime API
24+
25+
.LINK
26+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md
27+
28+
.LINK
29+
https://www.watttime.org/api-documentation/#login-amp-obtain-token
2430
#>
2531
function Get-WattTimeAuthToken {
2632
[CmdletBinding()]
@@ -59,6 +65,14 @@ function Get-WattTimeAuthToken {
5965
.NOTES
6066
A ba is WattTime's term for a balancing authority. A balancing authority is a regional entity that is responsible for maintaining the balance between supply and demand of electricity in a given region. For more information, see https://www.watttime.org/faq
6167
68+
.LINK
69+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTime.md
70+
71+
.LINK
72+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md
73+
74+
.LINK
75+
https://www.watttime.org/api-documentation/#real-time-emissions-index
6276
#>
6377
function Get-WattTime {
6478
[CmdletBinding()]
@@ -96,10 +110,20 @@ function Get-WattTime {
96110
ConvertFrom-AzureRegion -Region westeurope
97111
98112
.NOTES
99-
A ba is WattTime's term for a balancing authority. A balancing authority is a regional entity that is responsible for maintaining the balance between supply and demand of electricity in a given region. For more information, see https://www.watttime.org/faq
113+
- A ba is WattTime's term for a balancing authority. A balancing authority is a regional entity that is responsible for maintaining the balance between supply and demand of electricity in a given region. For more information, see https://www.watttime.org/faq
114+
- This command, like the module, requires you to be connected to Azure via Connect-AzAccount
100115
101116
.OUTPUTS
102117
a string containing the WattTime ba for the given Azure Region
118+
119+
.LINK
120+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/ConvertFrom-AzureRegion.md
121+
122+
.LINK
123+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md
124+
125+
.LINK
126+
https://www.watttime.org/api-documentation/#determine-grid-region
103127
#>
104128
function ConvertFrom-AzureRegion {
105129
[CmdletBinding()]
@@ -132,16 +156,28 @@ function ConvertFrom-AzureRegion {
132156
The Azure Region to get the WattTime index for
133157
134158
.PARAMETER AuthToken
135-
The authentication token to use for the request
159+
The WattTime API authentication token to use for the request
136160
137161
.EXAMPLE
138162
Get-WattTimeForAzureRegion -Region westeurope -AuthToken $authToken
139163
140164
.OUTPUTS
141165
System.Management.Automation.PSObject containing the following properties:
142-
ba: The WattTime ba for the given Azure Region
143-
percent: The current WattTime index for the given Azure Region
144-
region: The Azure Region for which the WattTime index was retrieved
166+
- ba: The WattTime ba for the given Azure Region
167+
- percent: The current WattTime index for the given Azure Region
168+
- region: The Azure Region for which the WattTime index was retrieved
169+
170+
.NOTES
171+
This command, like the module, requires you to be connected to Azure via Connect-AzAccount
172+
173+
.LINK
174+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeForAzureRegion.md
175+
176+
.LINK
177+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTime.md
178+
179+
.LINK
180+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md
145181
#>
146182
function Get-WattTimeForAzureRegion {
147183
[CmdletBinding()]
@@ -162,22 +198,31 @@ function Get-WattTimeForAzureRegion {
162198
Get the Azure region with the lowest wattTime index
163199
164200
.DESCRIPTION
165-
Get the current WattTime index for a given Azure Region
201+
Get the Azure region with the lowest wattTime index from a given set of regions
166202
167203
.PARAMETER Regions
168204
The list of Azure Regions to get the WattTime index for
169205
170206
.PARAMETER AuthToken
171-
The authentication token to use for the request
207+
The WattTime API authentication token to use for the request
172208
173209
.EXAMPLE
174210
Get-AzureRegionWithLowestWattTime -Regions westeurope,northeurope -AuthToken $authToken
175211
176212
.OUTPUTS
177213
System.Management.Automation.PSObject containing the following properties:
178-
ba: The WattTime ba for the given Azure Region
179-
percent: The current WattTime index for the given Azure Region
180-
region: The Azure Region for which the WattTime index was retrieved
214+
- ba: The WattTime ba for the given Azure Region
215+
- percent: The current WattTime index for the given Azure Region
216+
- region: The Azure Region for which the WattTime index was retrieved
217+
218+
.NOTES
219+
This command, like the module, requires you to be connected to Azure via Connect-AzAccount
220+
221+
.LINK
222+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-AzureRegionWithLowestWattTime.md
223+
224+
.LINK
225+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/Get-WattTimeAuthToken.md
181226
#>
182227
function Get-AzureRegionWithLowestWattTime {
183228
[CmdletBinding()]
@@ -196,11 +241,11 @@ function Get-AzureRegionWithLowestWattTime {
196241

197242
<#
198243
.SYNOPSIS
199-
Create a new WattTime account
244+
Create a new WattTime API account
200245
201246
.DESCRIPTION
202-
Creates a new PSWattTime account with the specified username,
203-
password, email and organization
247+
Creates a new WattTime API account with the specified username,
248+
password, email and organization on watttime.org
204249
205250
.PARAMETER Username
206251
The username for the new account
@@ -219,10 +264,17 @@ function Get-AzureRegionWithLowestWattTime {
219264
220265
.OUTPUTS
221266
System.Management.Automation.PSObject containing the following properties:
222-
username: The username for the new account
223-
email: The email address for the new account
224-
org: The organization for the new account
225-
token: The authentication token for the new account
267+
- user: The username for the new account
268+
- ok: The response for user creation
269+
270+
.NOTES
271+
You can use an email address only once at WattTime. Registering multiple accounts will fail with an error.
272+
273+
.LINK
274+
https://github.com/cloudyspells/PSWattTime/blob/main/docs/New-WattTimeAccount.md
275+
276+
.LINK
277+
https://www.watttime.org/api-documentation/#register-new-user
226278
#>
227279
function New-WattTimeAccount {
228280
[CmdletBinding()]

0 commit comments

Comments
 (0)