Skip to content

Commit 1b926cd

Browse files
authored
Change all instances of 'Get-InstalledPSResource' to 'Get-PSResource' (#545)
1 parent 66915dd commit 1b926cd

11 files changed

+59
-59
lines changed

Docs/GetPSResource.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Get-InstalledPSResource
1+
# Get-PSResource
22

3-
The `Get-InstalledPSResource` cmdlet combines the `Get-InstalledModule, Get-InstalledScript` cmdlets from V2.
3+
The `Get-PSResource` cmdlet combines the `Get-InstalledModule, Get-InstalledScript` cmdlets from V2.
44
It performs a search within module or script installation paths based on the `-Name` parameter argument.
55
It returns `PSRepositoryItemInfo` objects which describe each resource item found.
66
Other parameters allow the returned results to be filtered by version, prerelease version, and path.

help/Get-InstalledPSResource.md renamed to help/Get-PSResource.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,53 @@ online version:
55
schema: 2.0.0
66
---
77

8-
# Get-InstalledPSResource
8+
# Get-PSResource
99

1010
## SYNOPSIS
1111
Returns resources (modules and scripts) installed on the machine via PowerShellGet.
1212

1313
## SYNTAX
1414

1515
```
16-
Get-InstalledPSResource [[-Name] <String[]>] [-Version <String>] [-Path <String>] [<CommonParameters>]
16+
Get-PSResource [[-Name] <String[]>] [-Version <String>] [-Path <String>] [<CommonParameters>]
1717
```
1818

1919
## DESCRIPTION
20-
The Get-InstalledPSResource cmdlet combines the Get-InstalledModule, Get-InstalledScript cmdlets from V2. It performs a search within module or script installation paths based on the -Name parameter argument. It returns PSResourceInfo objects which describes each resource item found. Other parameters allow the returned results to be filtered by version and path.
20+
The Get-PSResource cmdlet combines the Get-InstalledModule, Get-InstalledScript cmdlets from V2. It performs a search within module or script installation paths based on the -Name parameter argument. It returns PSResourceInfo objects which describes each resource item found. Other parameters allow the returned results to be filtered by version and path.
2121

2222
## EXAMPLES
2323

2424
### Example 1
2525
```powershell
26-
PS C:\> Get-InstalledPSResource Az
26+
PS C:\> Get-PSResource Az
2727
```
2828

2929
This will return versions of the Az module installed via PowerShellGet.
3030

3131
### Example 2
3232
```powershell
33-
PS C:\> Get-InstalledPSResource Az -version "1.0.0"
33+
PS C:\> Get-PSResource Az -version "1.0.0"
3434
```
3535

3636
This will return version 1.0.0 of the Az module.
3737

3838
### Example 3
3939
```powershell
40-
PS C:\> Get-InstalledPSResource Az -version "(1.0.0, 3.0.0)"
40+
PS C:\> Get-PSResource Az -version "(1.0.0, 3.0.0)"
4141
```
4242

4343
This will return all versions of the Az module within the specified range.
4444

4545
### Example 4
4646
```powershell
47-
PS C:\> Get-InstalledPSResource Az -Path .
47+
PS C:\> Get-PSResource Az -Path .
4848
```
4949

5050
This will return all versions of the Az module that have been installed in the current directory.
5151

5252
### Example 5
5353
```powershell
54-
PS C:\> Get-InstalledPSResource
54+
PS C:\> Get-PSResource
5555
```
5656

5757
This will return all versions and scripts installed on the machine.

help/Update-PSResource.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ It does not return an object. Other parameters allow the package to be updated t
2727

2828
### Example 1
2929
```powershell
30-
PS C:\> Get-InstalledPSResource -Name "TestModule"
30+
PS C:\> Update-PSResource -Name "TestModule"
3131
Name Version Prerelease Description
3232
---- ------- ---------- -----------
3333
TestModule 1.2.0 test
3434
3535
PS C:\> Update-PSResource -Name "TestModule"
3636
37-
PS C:\> Get-InstalledPSResource -Name "TestModule"
37+
PS C:\> Update-PSResource -Name "TestModule"
3838
Name Version Prerelease Description
3939
---- ------- ---------- -----------
4040
TestModule 1.3.0 test

help/en-US/PowerShellGet.dll-Help.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
</command:command>
354354
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
355355
<command:details>
356-
<command:name>Get-InstalledPSResource</command:name>
356+
<command:name>Get-PSResource</command:name>
357357
<command:verb>Get</command:verb>
358358
<command:noun>PSResource</command:noun>
359359
<maml:description>

src/PowerShellGet.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
FormatsToProcess = 'PSGet.Format.ps1xml'
1616
CmdletsToExport = @(
1717
'Find-PSResource',
18-
'Get-InstalledPSResource',
18+
'Get-PSResource',
1919
'Get-PSResourceRepository',
2020
'Install-PSResource',
2121
'Register-PSResourceRepository',
@@ -63,7 +63,7 @@ All tests have been reviewed and rewritten as needed.
6363
- Install-PSResource no longer creates version folder with the prerelease tag
6464
- Update-PSResource can now update all resources, and no longer requires name param
6565
- Save-PSResource properly handles saving scripts
66-
- Get-InstalledPSResource uses default PowerShell paths
66+
- Get-PSResource uses default PowerShell paths
6767
'@
6868
}
6969
}

src/code/GetHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace Microsoft.PowerShell.PowerShellGet.Cmdlets
1515
{
1616
/// <summary>
17-
/// Get helper class provides the core functionality for Get-InstalledPSResource.
17+
/// Get helper class provides the core functionality for Get-PSResource.
1818
/// </summary>
1919
internal class GetHelper
2020
{

src/code/GetInstalledPSResource.cs renamed to src/code/GetPSResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ namespace Microsoft.PowerShell.PowerShellGet.Cmdlets
1313
/// It retrieves a resource that was installed with Install-PSResource
1414
/// Returns a single resource or multiple resource.
1515
/// </summary>
16-
[Cmdlet(VerbsCommon.Get, "InstalledPSResource")]
17-
public sealed class GetInstalledPSResource : PSCmdlet
16+
[Cmdlet(VerbsCommon.Get, "PSResource")]
17+
public sealed class GetPSResource : PSCmdlet
1818
{
1919
#region Members
2020

@@ -108,7 +108,7 @@ protected override void BeginProcessing()
108108

109109
protected override void ProcessRecord()
110110
{
111-
WriteVerbose("Entering GetInstalledPSResource");
111+
WriteVerbose("Entering GetPSResource");
112112

113113
var namesToSearch = Utils.ProcessNameWildcards(Name, out string[] errorMsgs, out bool _);
114114
foreach (string error in errorMsgs)

test/GetInstalledPSResource.Tests.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Import-Module "$psscriptroot\PSGetTestUtils.psm1" -Force
55

6-
Describe 'Test Get-InstalledPSResource for Module' {
6+
Describe 'Test Get-PSResource for Module' {
77

88
BeforeAll{
99
$TestGalleryName = Get-PoshTestGalleryName
@@ -23,17 +23,17 @@ Describe 'Test Get-InstalledPSResource for Module' {
2323
}
2424

2525
It "Get resources without any parameter values" {
26-
$pkgs = Get-InstalledPSResource
26+
$pkgs = Get-PSResource
2727
$pkgs.Count | Should -BeGreaterThan 1
2828
}
2929

3030
It "Get specific module resource by name" {
31-
$pkg = Get-InstalledPSResource -Name ContosoServer
31+
$pkg = Get-PSResource -Name ContosoServer
3232
$pkg.Name | Should -Contain "ContosoServer"
3333
}
3434

3535
It "Get specific script resource by name" {
36-
$pkg = Get-InstalledPSResource -Name TestTestScript
36+
$pkg = Get-PSResource -Name TestTestScript
3737
$pkg.Name | Should -Be "TestTestScript"
3838
}
3939

@@ -44,7 +44,7 @@ Describe 'Test Get-InstalledPSResource for Module' {
4444
@{Name="Cont*erver"; ExpectedName="ContosoServer"; Reason="validate name, with wildcard in middle of name: Cont*erver"}
4545
) {
4646
param($Version, $ExpectedVersion)
47-
$pkgs = Get-InstalledPSResource -Name $Name
47+
$pkgs = Get-PSResource -Name $Name
4848
$pkgs.Name | Should -Contain "ContosoServer"
4949
}
5050

@@ -61,7 +61,7 @@ $testCases =
6161

6262
It "Get resource when given Name to <Reason> <Version>" -TestCases $testCases {
6363
param($Version, $ExpectedVersion)
64-
$pkgs = Get-InstalledPSResource -Name "ContosoServer" -Version $Version
64+
$pkgs = Get-PSResource -Name "ContosoServer" -Version $Version
6565
$pkgs.Name | Should -Contain "ContosoServer"
6666
$pkgs.Version | Should -Be $ExpectedVersion
6767
}
@@ -105,25 +105,25 @@ $testCases =
105105
}
106106

107107
It "Get resources when given Name, and Version is '*'" {
108-
$pkgs = Get-InstalledPSResource -Name ContosoServer -Version "*"
108+
$pkgs = Get-PSResource -Name ContosoServer -Version "*"
109109
$pkgs.Count | Should -BeGreaterOrEqual 2
110110
}
111111

112112
It "Get prerelease version module when version with correct prerelease label is specified" {
113113
Install-PSResource -Name $testModuleName -Version "5.2.5-alpha001" -Repository $TestGalleryName
114-
$res = Get-InstalledPSResource -Name $testModuleName -Version "5.2.5"
114+
$res = Get-PSResource -Name $testModuleName -Version "5.2.5"
115115
$res | Should -BeNullOrEmpty
116-
$res = Get-InstalledPSResource -Name $testModuleName -Version "5.2.5-alpha001"
116+
$res = Get-PSResource -Name $testModuleName -Version "5.2.5-alpha001"
117117
$res.Name | Should -Be $testModuleName
118118
$res.Version | Should -Be "5.2.5"
119119
$res.PrereleaseLabel | Should -Be "alpha001"
120120
}
121121

122122
It "Get prerelease version script when version with correct prerelease label is specified" {
123123
Install-PSResource -Name $testScriptName -Version "3.0.0-alpha001" -Repository $TestGalleryName
124-
$res = Get-InstalledPSResource -Name $testScriptName -Version "3.0.0"
124+
$res = Get-PSResource -Name $testScriptName -Version "3.0.0"
125125
$res | Should -BeNullOrEmpty
126-
$res = Get-InstalledPSResource -Name $testScriptName -Version "3.0.0-alpha001"
126+
$res = Get-PSResource -Name $testScriptName -Version "3.0.0-alpha001"
127127
$res.Name | Should -Be $testScriptName
128128
$res.Version | Should -Be "3.0.0"
129129
$res.PrereleaseLabel | Should -Be "alpha001"

test/InstallPSResource.Tests.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Describe 'Test Install-PSResource for Module' {
4444

4545
It "Install specific script resource by name" {
4646
Install-PSResource -Name "TestTestScript" -Repository $TestGalleryName
47-
$pkg = Get-InstalledPSResource "TestTestScript"
47+
$pkg = Get-PSResource "TestTestScript"
4848
$pkg.Name | Should -Be "TestTestScript"
4949
$pkg.Version | Should -Be "1.3.1.0"
5050
}
@@ -225,7 +225,7 @@ Describe 'Test Install-PSResource for Module' {
225225

226226
It "Install resource that requires accept license with -AcceptLicense flag" {
227227
Install-PSResource -Name "testModuleWithlicense" -Repository $TestGalleryName -AcceptLicense
228-
$pkg = Get-InstalledPSResource "testModuleWithlicense"
228+
$pkg = Get-PSResource "testModuleWithlicense"
229229
$pkg.Name | Should -Be "testModuleWithlicense"
230230
$pkg.Version | Should -Be "0.0.3.0"
231231
}
@@ -243,12 +243,12 @@ Describe 'Test Install-PSResource for Module' {
243243

244244
It "Install resource with cmdlet names from a module already installed (should clobber)" {
245245
Install-PSResource -Name "myTestModule" -Repository $TestGalleryName
246-
$pkg = Get-InstalledPSResource "myTestModule"
246+
$pkg = Get-PSResource "myTestModule"
247247
$pkg.Name | Should -Be "myTestModule"
248248
$pkg.Version | Should -Be "0.0.3.0"
249249

250250
Install-PSResource -Name "myTestModule2" -Repository $TestGalleryName
251-
$pkg = Get-InstalledPSResource "myTestModule2"
251+
$pkg = Get-PSResource "myTestModule2"
252252
$pkg.Name | Should -Be "myTestModule2"
253253
$pkg.Version | Should -Be "0.0.1.0"
254254
}
@@ -291,7 +291,7 @@ Describe 'Test Install-PSResource for Module' {
291291
}
292292
It "Install PSResourceInfo object piped in" {
293293
Find-PSResource -Name $testModuleName -Version "1.1.0.0" -Repository $TestGalleryName | Install-PSResource
294-
$res = Get-InstalledPSResource -Name $testModuleName
294+
$res = Get-PSResource -Name $testModuleName
295295
$res.Name | Should -Be $testModuleName
296296
$res.Version | Should -Be "1.1.0.0"
297297
}
@@ -328,7 +328,7 @@ Describe 'Test Install-PSResource for interactive and root user scenarios' {
328328
# This needs to be manually tested due to prompt
329329
It "Install resource that requires accept license without -AcceptLicense flag" {
330330
Install-PSResource -Name "testModuleWithlicense" -Repository $TestGalleryName
331-
$pkg = Get-InstalledPSResource "testModuleWithlicense"
331+
$pkg = Get-PSResource "testModuleWithlicense"
332332
$pkg.Name | Should -Be "testModuleWithlicense"
333333
$pkg.Version | Should -Be "0.0.1.0"
334334
}

test/UninstallPSResource.Tests.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,29 +141,29 @@ Describe 'Test Uninstall-PSResource for Modules' {
141141
It "Uninstall prerelease version module when prerelease version specified" {
142142
Install-PSResource -Name $testModuleName -Version "5.2.5-alpha001" -Repository $TestGalleryName
143143
Uninstall-PSResource -Name $testModuleName -Version "5.2.5-alpha001"
144-
$res = Get-InstalledPSResource $testModuleName -Version "5.2.5-alpha001"
144+
$res = Get-PSResource $testModuleName -Version "5.2.5-alpha001"
145145
$res | Should -BeNullOrEmpty
146146
}
147147

148148
It "Not uninstall non-prerelease version module when similar prerelease version is specified" {
149149
Install-PSResource -Name $testModuleName -Version "5.0.0.0" -Repository $TestGalleryName
150150
Uninstall-PSResource -Name $testModuleName -Version "5.0.0-preview"
151-
$res = Get-InstalledPSResource -Name $testModuleName -Version "5.0.0.0"
151+
$res = Get-PSResource -Name $testModuleName -Version "5.0.0.0"
152152
$res.Name | Should -Be $testModuleName
153153
$res.Version | Should -Be "5.0.0.0"
154154
}
155155

156156
It "Uninstall prerelease version script when prerelease version specified" {
157157
Install-PSResource -Name $testScriptName -Version "3.0.0-alpha001" -Repository $TestGalleryName
158158
Uninstall-PSResource -Name $testScriptName -Version "3.0.0-alpha001"
159-
$res = Get-InstalledPSResource -Name $testScriptName
159+
$res = Get-PSResource -Name $testScriptName
160160
$res | Should -BeNullOrEmpty
161161
}
162162

163163
It "Not uninstall non-prerelease version module when prerelease version specified" {
164164
Install-PSResource -Name $testScriptName -Version "2.5.0.0" -Repository $TestGalleryName
165165
Uninstall-PSResource -Name $testScriptName -Version "2.5.0-alpha001"
166-
$res = Get-InstalledPSResource -Name $testScriptName -Version "2.5.0.0"
166+
$res = Get-PSResource -Name $testScriptName -Version "2.5.0.0"
167167
$res.Name | Should -Be $testScriptName
168168
$res.Version | Should -Be "2.5.0.0"
169169
}
@@ -197,15 +197,15 @@ Describe 'Test Uninstall-PSResource for Modules' {
197197

198198
It "Uninstall PSResourceInfo object piped in" {
199199
Install-PSResource -Name "ContosoServer" -Version "1.5.0.0" -Repository $TestGalleryName
200-
Get-InstalledPSResource -Name "ContosoServer" -Version "1.5.0.0" | Uninstall-PSResource
201-
$res = Get-InstalledPSResource -Name "ContosoServer" -Version "1.5.0.0"
200+
Get-PSResource -Name "ContosoServer" -Version "1.5.0.0" | Uninstall-PSResource
201+
$res = Get-PSResource -Name "ContosoServer" -Version "1.5.0.0"
202202
$res | Should -BeNullOrEmpty
203203
}
204204

205205
It "Uninstall PSResourceInfo object piped in for prerelease version object" {
206206
Install-PSResource -Name $testModuleName -Version "4.5.2-alpha001" -Repository $TestGalleryName
207-
Get-InstalledPSResource -Name $testModuleName -Version "4.5.2-alpha001" | Uninstall-PSResource
208-
$res = Get-InstalledPSResource -Name $testModuleName -Version "4.5.2-alpha001"
207+
Get-PSResource -Name $testModuleName -Version "4.5.2-alpha001" | Uninstall-PSResource
208+
$res = Get-PSResource -Name $testModuleName -Version "4.5.2-alpha001"
209209
$res | Should -BeNullOrEmpty
210210
}
211211
}

0 commit comments

Comments
 (0)