-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98cdcac
commit 1f28730
Showing
118 changed files
with
902 additions
and
1,719 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
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,3 +1,3 @@ | ||
# Demo | ||
|
||
Demo repo for actions | ||
Demo repository for a PSModule |
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,13 @@ | ||
@{ | ||
ModuleVersion = '0.0.1' | ||
Description = 'This module is for working with settings and addons in WoW with PowerShell' | ||
PrivateData = @{ | ||
PSData = @{ | ||
Tags = 'WoW', 'retail', 'Games', 'Multiboxing' | ||
LicenseUri = 'https://dev.azure.com/PSModule/WoW/' | ||
ProjectUri = 'https://dev.azure.com/PSModule/WoW/' | ||
IconUri = 'https://dev.azure.com/PSModule/WoW/icons/icon.png' | ||
} | ||
} | ||
} | ||
|
File renamed without changes.
File renamed without changes.
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 @@ | ||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Justification = 'Contains long links.')] |
4 changes: 1 addition & 3 deletions
4
src/WoWManager/classes/Classes.ps1 → src/WoW/classes/Classes.ps1
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
File renamed without changes.
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,16 @@ | ||
Function Export-WoWAccount { | ||
<# | ||
.SYNOPSIS | ||
Short description | ||
.DESCRIPTION | ||
Long description | ||
.EXAMPLE | ||
An example | ||
.NOTES | ||
General notes | ||
#> | ||
Get-WoWAccount | ConvertTo-Json -EnumsAsStrings | Out-File -FilePath "$Script:WoW_Folder_Cache\Accounts.json" -Force | ||
} |
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
16 changes: 16 additions & 0 deletions
16
...ger/private/Addon/Initialize-WoWAddon.ps1 → ...WoW/private/Addon/Initialize-WoWAddon.ps1
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Function Export-BNetAPISetting { | ||
<# | ||
.SYNOPSIS | ||
Short description | ||
.DESCRIPTION | ||
Long description | ||
.EXAMPLE | ||
An example | ||
.NOTES | ||
General notes | ||
#> | ||
[CmdletBinding()] | ||
param() | ||
Write-WoWVerbose 'Export-BNetAPISetting: Export: Start' | ||
Get-BNetAPIRegion | Select-Object Region | ConvertTo-Json -EnumsAsStrings | | ||
Out-File -FilePath "$Script:WoW_Folder_Cache\BNetAPISettings.json" -Force | ||
Write-WoWVerbose 'Export-BNetAPISetting: Export: Done' | ||
} |
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,46 @@ | ||
|
||
Function Get-BNetAPIUserAccessToken { | ||
<# | ||
.SYNOPSIS | ||
Short description | ||
.DESCRIPTION | ||
Long description | ||
.PARAMETER Token | ||
Parameter description | ||
.PARAMETER Region | ||
Parameter description | ||
.EXAMPLE | ||
An example | ||
.NOTES | ||
General notes | ||
#> | ||
[CmdletBinding()] | ||
param( | ||
$Token = $Script:BNetAPI_AccessToken, | ||
$Region = $Script:BNetAPI_Settings.Region | ||
) | ||
$Body = @{ | ||
':region' = $Region | ||
token = $Token | ||
} | ||
|
||
try { | ||
$params = @{ | ||
Method = 'Post' | ||
Uri = "$($Script:BNetAPI_Settings.BNetAPIPath)oauth/check_token" | ||
Body = $Body | ||
ContentType = 'application/x-www-form-urlencoded' | ||
ErrorAction = 'Stop' | ||
} | ||
|
||
$Response = Invoke-RestMethod @params | ||
} catch { | ||
throw $_ | ||
} | ||
return $Response | ||
} |
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,39 @@ | ||
Function Get-BNetAPIUserInfo { | ||
<# | ||
.SYNOPSIS | ||
Short description | ||
.DESCRIPTION | ||
Long description | ||
.PARAMETER Token | ||
Parameter description | ||
.EXAMPLE | ||
An example | ||
.NOTES | ||
General notes | ||
#> | ||
[CmdletBinding()] | ||
param( | ||
$Token = $Script:BNetAPI_AccessToken | ||
) | ||
$Headers = @{ | ||
Authorization = "Bearer $Token" | ||
} | ||
|
||
try { | ||
$params = @{ | ||
Method = 'Get' | ||
Uri = "$($Script:BNetAPI_Settings.BNetAPIPath)oauth/userinfo" | ||
Headers = $Headers | ||
ContentType = 'application/x-www-form-urlencoded' | ||
ErrorAction = 'Stop' | ||
} | ||
$Response = Invoke-RestMethod @params | ||
} catch { | ||
throw $_ | ||
} | ||
return $Response | ||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Function Import-BNetAPISetting { | ||
<# | ||
.SYNOPSIS | ||
Short description | ||
.DESCRIPTION | ||
Long description | ||
.EXAMPLE | ||
An example | ||
.NOTES | ||
General notes | ||
#> | ||
[CmdletBinding()] | ||
param() | ||
Write-WoWVerbose 'Import-BNetAPISetting: Import: Start' | ||
$CacheFilePath = "$Script:WoW_Folder_Cache\BNetAPISettings.json" | ||
if (Test-Path $CacheFilePath) { | ||
$ImportedBNetAPISettings = Get-Content $CacheFilePath | ConvertFrom-Json | ||
Write-WoWVerbose "Import-BNetAPISetting: Import: Setting region to $($ImportedBNetAPISettings.Region)" | ||
Set-BNetAPIRegion -Region $ImportedBNetAPISettings.Region | ||
Write-WoWVerbose 'Import-BNetAPISetting: Import: Done' | ||
} else { | ||
Write-WoWVerbose 'Import-BNetAPISetting: Import: Nothing to import' | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
#https://develop.battle.net/documentation/guides/using-oauth/client-credentials-flow | ||
Function New-BNetAPIUserAccessToken { | ||
<# | ||
.SYNOPSIS | ||
Short description | ||
.DESCRIPTION | ||
Long description | ||
.PARAMETER ClientID | ||
Parameter description | ||
.PARAMETER ClientSecret | ||
Parameter description | ||
.EXAMPLE | ||
An example | ||
.NOTES | ||
General notes | ||
#> | ||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute( | ||
'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function', | ||
Justification = 'Not changing state, just an object in memory.' | ||
)] | ||
[CmdletBinding()] | ||
param( | ||
$ClientID = $Script:BNetAPI_ClientID, | ||
$ClientSecret = $Script:BNetAPI_ClientSecret | ||
) | ||
$Body = @{ | ||
client_id = $ClientID | ||
client_secret = $ClientSecret | ||
grant_type = 'client_credentials' | ||
scope = '' | ||
} | ||
|
||
try { | ||
$params = @{ | ||
Method = 'Post' | ||
Uri = "$($Script:BNetAPI_Settings.BNetAPIPath)oauth/token" | ||
Body = $Body | ||
ContentType = 'application/x-www-form-urlencoded' | ||
ErrorAction = 'Stop' | ||
} | ||
$Response = Invoke-RestMethod @params | ||
} catch { | ||
throw $_ | ||
} | ||
return $Response.access_token | ||
} |
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,16 @@ | ||
Function Export-WoWCharacter { | ||
<# | ||
.SYNOPSIS | ||
Short description | ||
.DESCRIPTION | ||
Long description | ||
.EXAMPLE | ||
An example | ||
.NOTES | ||
General notes | ||
#> | ||
Get-WoWCharacter | ConvertTo-Json -EnumsAsStrings | Out-File -FilePath "$Script:WoW_Folder_Cache\Characters.json" -Force | ||
} |
Oops, something went wrong.