You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: help/Get-PSResource.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ The Get-PSResource cmdlet combines the Get-InstalledModule, Get-InstalledScript
26
26
PS C:\> Get-PSResource Az
27
27
```
28
28
29
-
This will return versions of the Az module installed via PowerShellGet.
29
+
This will return versions (stable and prerelease) of the Az module installed via PowerShellGet.
30
30
31
31
### Example 2
32
32
```powershell
@@ -44,12 +44,32 @@ This will return all versions of the Az module within the specified range.
44
44
45
45
### Example 4
46
46
```powershell
47
+
PS C:\> Get-PSResource Az -version "4.0.1-preview"
48
+
```
49
+
50
+
Assume that the package Az version 4.0.1-preview is already installed. This will return version 4.0.1-preview of the Az module.
51
+
52
+
```powershell
53
+
PS C:\> Get-PSResource Az -version "4.0.1"
54
+
```
55
+
Assume that the package Az version 4.0.1-preview is already installed. This will not return Az version 4.0.1-preview as the full version (including prerelease label, i.e "4.0.1-preview") was not specified.
56
+
57
+
### Example 5
58
+
```powershell
59
+
PS C:\> Get-PSResource Az -Version "[4.0.1, 4.0.2-preview]
60
+
```
61
+
62
+
Assume that the following versions are already installed for package Az: 4.0.1-preview and 4.0.2-preview. This will only return version 4.0.2-preview as it is the only one which falls within the specified version range. Per NuGetVersion rules, a prerelease version is less than a stable version, so 4.0.1-preview is less than the 4.0.1 specified version so 4.0.1-preview does not fall within the specified version range and won't be returned.
63
+
64
+
65
+
### Example 6
66
+
```powershell
47
67
PS C:\> Get-PSResource Az -Path .
48
68
```
49
69
50
70
This will return all versions of the Az module that have been installed in the current directory.
Copy file name to clipboardExpand all lines: help/Uninstall-PSResource.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,11 +47,24 @@ Uninstalls version 1.0.0 of the Az module.
47
47
### Example 3
48
48
```powershell
49
49
PS C:\> Uninstall-PSResource -name Az -version "(1.0.0, 3.0.0)"
50
+
```
50
51
51
52
Uninstalls all versions within the specified version range.
53
+
54
+
### Example 4
55
+
```powershell
56
+
PS C:\> Uninstall-PSResource -name Az -version "[4.0.1, 4.1.0]"
52
57
```
53
58
54
-
Uninstalls version 1.0.0 of the Az module.
59
+
Assume that the following versions are already installed for package Az: 4.0.1-preview, 4.1.0, 4.0.2-preview installed, this will uninstall all versions (stable and prerelease) which fall within the specified version range. Per NuGetVersion rules, a prerelease version is less than a stable version, so 4.0.1-preview is actually less than the 4.0.1 specified version so 4.0.1-preview does not fall within the specified version range and won't be removed. Versions 4.1.0 and 4.0.2-preview do fall in the range and will both be removed.
60
+
61
+
### Example 4
62
+
```powershell
63
+
PS C:\> Uninstall-PSResource -name Az -version "[4.0.1, 4.1.0]" -Prerelease
64
+
```
65
+
66
+
Assume that the following versions are already installed for package Az: 4.0.1-preview, 4.1.0, 4.0.2-preview installed. This is the same example as above, except the added `-Prerelease` parameter means only prerelease versions which fall within this range will be removed. Again, per NuGetVersion rules, a prerelease version is less than a stable version, so 4.0.1-preview is actually less than the 4.0.1 specified version. Therefore 4.0.1-preview does not fall within the specified version range and won't be removed. Version 4.1.0 does fall in range however it is not a prerelease version so it will remain installed. Version 4.0.2-preview does fall in the range and is prerelease so it will be removed.
0 commit comments