-
Notifications
You must be signed in to change notification settings - Fork 157
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
cdc2074
commit 8c9094c
Showing
9 changed files
with
115 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!-- #include "./common/header.md" --> | ||
|
||
# Show-VSTeamPackage | ||
|
||
## SYNOPSIS | ||
|
||
<!-- #include "./synopsis/Show-VSTeamPackage.md" --> | ||
|
||
## SYNTAX | ||
|
||
## DESCRIPTION | ||
|
||
<!-- #include "./synopsis/Show-VSTeamPackage.md" --> | ||
|
||
## EXAMPLES | ||
|
||
### Example 1: From pipeline | ||
|
||
```powershell | ||
Get-VSTeamPackage -feedName vsteam -Top 1 -Skip 2 | Show-VSTeamPackage | ||
``` | ||
|
||
This command will open a web browser with this package showing. | ||
|
||
### Example 2: By parameter | ||
|
||
```powershell | ||
$p = Get-VSTeamPackage -feedName vsteam -Top 1 -Skip 2 | ||
Show-VSTeamPackage $p | ||
``` | ||
|
||
This command will open a web browser with this package showing. | ||
|
||
## PARAMETERS | ||
|
||
### Package | ||
|
||
Package to show | ||
|
||
```yaml | ||
Type: vsteam_lib.Package | ||
Required: True | ||
Position: 0 | ||
Accept pipeline input: true (ByPropertyName) | ||
``` | ||
## INPUTS | ||
### vsteam_lib.Package | ||
## OUTPUTS | ||
### vsteam_lib.Package | ||
## NOTES | ||
<!-- #include "./common/prerequisites.md" --> | ||
## RELATED LINKS | ||
<!-- #include "./common/related.md" --> | ||
[Add-VSTeamPackage](Add-VSTeamPackage.md) |
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 @@ | ||
Opens the package in the default browser. |
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,13 @@ | ||
function Show-VSTeamPackage { | ||
[CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamPackage')] | ||
param( | ||
[Parameter(Position = 0, Mandatory, ValueFromPipeline)] | ||
[vsteam_lib.Package] $package | ||
) | ||
|
||
process { | ||
_hasAccount | ||
|
||
Show-Browser "$(_getInstance)/_packaging?_a=package&feedName=$($package.FeedId)&package=$($package.Name)&protocolType=$($package.ProtocolType)&version=$($p.Versions[0].version)" | ||
} | ||
} |
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,25 @@ | ||
Set-StrictMode -Version Latest | ||
|
||
Describe 'VSTeamPackage' { | ||
BeforeAll { | ||
. "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath | ||
|
||
## Arrange | ||
Mock Show-Browser | ||
Mock _getInstance { return 'https://dev.azure.com/test' } | ||
} | ||
|
||
Context 'Show-VSTeamPackage' { | ||
It 'by name should call show-browser' { | ||
## Arrange | ||
$p = [vsteam_lib.Package]::new($(Open-SampleFile 'Get-VSTeamPackage.json' -Index 0), | ||
'00000000-0000-0000-0000-000000000001') | ||
|
||
## Act | ||
Show-VSTeamPackage $p | ||
|
||
## Assert | ||
Should -Invoke Show-Browser | ||
} | ||
} | ||
} |
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