This repository was archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathGet-PSResource.ps1
More file actions
83 lines (73 loc) · 3.63 KB
/
Copy pathGet-PSResource.ps1
File metadata and controls
83 lines (73 loc) · 3.63 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
function Get-PSResource {
[OutputType([PsCustomObject])]
[cmdletbinding(SupportsShouldProcess = $true)]
Param
(
# Specifies the resources to get.
[Parameter(ValueFromPipelineByPropertyName = $true,
Position = 0)]
[ValidateNotNullOrEmpty()]
[String[]]
$Name,
# Specifies the type of resource to get.
[Parameter(ValueFromPipelineByPropertyName = $true)]
[ValidateSet('Module', 'Script', 'Nupkg')]
[string[]]
$Type,
# Specifies the minimum version of the resource to return (cannot use this parameter with the RequiredVersion or AllVersions parameters).
[Parameter(ValueFromPipelineByPropertyName = $true)]
[ValidateNotNull()]
[string]
$MinimumVersion,
# Specifies the required version of the resource to return (cannot use this parameter with the MinimumVersion, MaximumVersion, or AllVersions parameters).
[Parameter(ValueFromPipelineByPropertyName = $true)]
[ValidateNotNull()]
[string]
$RequiredVersion,
# Specifies the maximum version of the resource to return (cannot use this parameter with the RequiredVersion or AllVersions parameters).
[Parameter(ValueFromPipelineByPropertyName = $true)]
[ValidateNotNull()]
[string]
$MaximumVersion,
# Displays all versions of the resource that have been installed (cannot use this parameter with the MinimumVersion, MaximumVersion, or RequiredVersion parameters).
[Parameter()]
[switch]
$AllVersions,
# Allows returning prerelease versions.
[Parameter()]
[switch]
$Prerelease
)
begin { }
process {
foreach ($n in $Name) {
if ($pscmdlet.ShouldProcess($n)) {
$PSResource = New-Object PSObject -Property @{
Name = $Name
Version = "placeholder-for-module-version"
Type = "placeholder-for-type"
Description = "placeholder-for-description"
Author = "placeholder-for-author"
CompanyName = "placeholder-for-company-name"
Copyright = "placeholder-for-copyright"
PublishedDate = "placeholder-for-published-date"
InstalledDate = "placeholder-for-installed-date"
UpdatedDate = "placeholder-for-updated-date"
LicenseUri = "placeholder-for-license-uri"
ProjectUri = "placeholder-for-project-uri"
IconUri = "placeholder-for-icon-uri"
Tags = "placeholder-for-tags"
Includes = "placeholder-for-includes"
PowerShellGetFormatVersion = "placeholder-for-powershellget-format-version"
ReleaseNotes = "placeholder-for-release-notes"
Dependencies = "placeholder-for-dependencies"
URL = "placeholder-for-url"
Repository = "placeholder-for-repository" #???
AdditonalMetadata = "placehodler-for-additional-metadata"
}
return $PSResource
}
}
}
end { }
}