forked from jdhitsolutions/PSScriptTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompare-Module.yml
More file actions
125 lines (90 loc) · 3.25 KB
/
Copy pathCompare-Module.yml
File metadata and controls
125 lines (90 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
examples:
- name: EXAMPLE 1
preCode: ''
code: >-
PS C:\> Compare-Module | Where-object {$_.UpdateNeeded}
Name : DNSSuffix
OnlineVersion : 0.4.1
InstalledVersion : 0.2.0
PublishedDate : 10/22/2018 8:21:46 PM
UpdateNeeded : True
Name : InvokeBuild
OnlineVersion : 5.4.2
InstalledVersion : 3.2.2
PublishedDate : 12/7/2018 1:30:46 AM
UpdateNeeded : True
...
postCode: List all modules that could be updated.
- name: EXAMPLE 2
preCode: ''
code: PS C:\> Compare-Module | Where UpdateNeeded | Out-Gridview -title "Select modules to update" -outputMode multiple | Foreach { Update-Module $_.name }
postCode: Compare modules and send results to Out-Gridview. Use Out-Gridview as an object picker to decide what modules to update.
- name: EXAMPLE 3
preCode: ''
code: >-
PS C:\> compare-module -name xWin* | format-table
Name OnlineVersion InstalledVersion PublishedDate UpdateNeeded
---- ------------- ---------------- ------------- ------------
xWindowsUpdate 2.7.0.0 2.7.0.0,2.5.0.0 7/12/2017 10:43:54 PM False
xWinEventLog 1.2.0.0 1.2.0.0 6/13/2018 8:06:45 PM False
postCode: Compare all modules that start with xWin* and display results in a table format.
- name: EXAMPLE 4
preCode: ''
code: >-
PS C:\> get-dscresource xAD* | Select moduleName -Unique | compare-module
Name : xActiveDirectory
OnlineVersion : 2.22.0.0
InstalledVersion : 2.16.0.0,2.14.0.0
PublishedDate : 10/25/2018 5:25:24 PM
UpdateNeeded : True
Name : xAdcsDeployment
OnlineVersion : 1.4.0.0
InstalledVersion : 1.1.0.0,1.0.0.0
PublishedDate : 12/20/2017 10:10:43 PM
UpdateNeeded : True
postCode: Get all DSC Resources that start with xAD and select the corresponding module name. Since the module name will be listed for every resource, get a unique list and pipe that to Compare-Module.
inputs:
- type: '[string]'
description: ''
links:
- href: https://github.com/jdhitsolutions/PSScriptTools/blob/master/docs/Compare-Module.md
text: 'Online Version:'
- href: ''
text: Find-Module
- href: ''
text: Get-Module
- href: ''
text: Update-Module
module:
name: PSScriptTools
name: Compare-Module
notes: 'Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/'
optionalParameters:
- name: Name
acceptWildcardCharacters: true
aliases:
- modulename
defaultValue: None
description: The name of a module to check. Wildcards are permitted.
parameterValueGroup: []
pipelineInput: True (ByPropertyName)
position: 1
type: String
- name: Gallery
aliases: []
defaultValue: PSGallery
description: Specify the remote repository or gallery to check.
parameterValueGroup: []
pipelineInput: False
position: Named
type: String
outputs:
- type: PSCustomObject
description: ''
requiredParameters: []
remarks: Use this command to compare module versions between what is installed against an online repository like the PSGallery. Results will be automatically sorted by module name.
summary: Compare PowerShell module versions.
syntaxes:
- parameters:
- Name
- Gallery