-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from jvlflame/dev
2.2.10
- Loading branch information
Showing
11 changed files
with
260 additions
and
24 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
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,31 @@ | ||
function Get-JVModuleInfo { | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter()] | ||
[String]$ModuleManifestUrl | ||
) | ||
|
||
begin { | ||
if ($PSBoundParameters.ContainsKey('ModuleManifestUrl')) { | ||
try { | ||
$moduleManifest = Invoke-RestMethod -Uri $ModuleManifestUrl -Verbose:$false | ||
} catch { | ||
Write-Error "Error occurred when checking for new version: $PSItem" -ErrorAction Stop | ||
} | ||
} else { | ||
$moduleManifest = Get-Content -LiteralPath (Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'Javinizer.psd1') | ||
} | ||
} | ||
|
||
process { | ||
$moduleInfo = [PSCustomObject]@{ | ||
Version = ($moduleManifest | Select-String -Pattern "ModuleVersion\s*= '(.*)'").Matches.Groups[1].Value | ||
Prerelease = ($moduleManifest | Select-String -Pattern "Prerelease\s*= '(.*)'").Matches.Groups[1].Value | ||
Project = ($moduleManifest | Select-String -Pattern "ProjectUri\s*= '(.*)'").Matches.Groups[1].Value | ||
License = ($moduleManifest | Select-String -Pattern "LicenseUri\s*= '(.*)'").Matches.Groups[1].Value | ||
ReleaseNotes = ($moduleManifest | Select-String -Pattern "ReleaseNotes\s*= '(.*)'").Matches.Groups[1].Value | ||
} | ||
|
||
Write-Output $moduleInfo | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
function Get-JVSettings { | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter()] | ||
[System.IO.FileInfo]$Path | ||
) | ||
|
||
process { | ||
if ($PSBoundParameters.ContainsKey('Path')) { | ||
$settingsPath = $Path | ||
} else { | ||
$settingsPath = Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'jvSettings.json' | ||
} | ||
|
||
try { | ||
$rawSettings = Get-Content -Path $settingsPath -Raw | ||
$settings = $rawSettings | ConvertFrom-Json -Depth 32 | ||
} catch { | ||
Write-Error "Error occurred when retrieving settings: $PSItem" -ErrorAction Stop | ||
} | ||
|
||
Write-Output $settings | ||
} | ||
} |
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
Oops, something went wrong.