mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Enable PackageManagement module in OPS module store
This commit is contained in:
1 parent
8cfc6d6687
commit
0b2d362220
3 files changed
+927
No files matched your search
@@ -0,0 +1,488 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Configuration>
|
||||
<!--
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
-->
|
||||
<ViewDefinitions>
|
||||
<View>
|
||||
<Name>package</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Packaging.SoftwareIdentity</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Packaging.SoftwareIdentity</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>30</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Version</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Source</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Summary</PropertyName>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
|
||||
<View>
|
||||
<Name>GetPackage</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Packaging.SoftwareIdentity#GetPackage</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Packaging.SoftwareIdentity#GetPackage</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>30</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>32</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Version</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Source</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>ProviderName</PropertyName>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
|
||||
<View>
|
||||
<Name>packageWithLongSourceName</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayLongSourceName</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayLongSourceName</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>30</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>32</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Version</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Source</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Summary</PropertyName>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
|
||||
<View>
|
||||
<Name>packageWithLongSourceNameAndCulture</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayLongSourceName#DisplayCulture</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayLongSourceName#DisplayCulture</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>30</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>32</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Version</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Culture</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Source</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Summary</PropertyName>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
|
||||
<View>
|
||||
<Name>packageWithLongSourceNameAndName</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayLongSourceName#DisplayLongName</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayLongSourceName#DisplayLongName</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>45</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>32</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Version</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Source</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Summary</PropertyName>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
<View>
|
||||
<Name>packageWithLongSourceNameAndCultureAndName</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayLongSourceName#DisplayCulture#DisplayLongName</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayLongSourceName#DisplayCulture#DisplayLongName</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>42</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>24</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Version</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Culture</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Source</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Summary</PropertyName>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
|
||||
<View>
|
||||
<Name>PackageWithCulture</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayCulture</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayCulture</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>30</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Version</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Culture</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Source</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Summary</PropertyName>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
<View>
|
||||
<Name>PackageWithLongName</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayLongName</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayLongName</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>52</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Version</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Source</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Summary</PropertyName>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
<View>
|
||||
<Name>PackageWithCultureAndLongName</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayCulture#DisplayLongName</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Packaging.SoftwareIdentity#DisplayCulture#DisplayLongName</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>52</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Version</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Culture</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Source</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Summary</PropertyName>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
<View>
|
||||
<Name>PackageSource</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Packaging.PackageSource</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Packaging.PackageSource</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>32</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>10</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>ProviderName</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>IsTrusted</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Location</PropertyName>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
|
||||
<View>
|
||||
<Name>PackageProvider</Name>
|
||||
<ViewSelectedBy>
|
||||
<TypeName>Microsoft.PackageManagement.Implementation.PackageProvider</TypeName>
|
||||
<TypeName>Deserialized.Microsoft.PackageManagement.Implementation.PackageProvider</TypeName>
|
||||
</ViewSelectedBy>
|
||||
<TableControl>
|
||||
<TableHeaders>
|
||||
<TableColumnHeader>
|
||||
<Width>24</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Width>16</Width>
|
||||
</TableColumnHeader>
|
||||
<TableColumnHeader>
|
||||
<Label>DynamicOptions</Label>
|
||||
</TableColumnHeader>
|
||||
</TableHeaders>
|
||||
<TableRowEntries>
|
||||
<TableRowEntry>
|
||||
<TableColumnItems>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Name</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<PropertyName>Version</PropertyName>
|
||||
</TableColumnItem>
|
||||
<TableColumnItem>
|
||||
<ScriptBlock>$options = $_.DynamicOptions.Name | select-object -unique; $options -join ", "</ScriptBlock>
|
||||
</TableColumnItem>
|
||||
</TableColumnItems>
|
||||
</TableRowEntry>
|
||||
</TableRowEntries>
|
||||
</TableControl>
|
||||
</View>
|
||||
|
||||
|
||||
</ViewDefinitions>
|
||||
</Configuration>
|
||||
@@ -0,0 +1,57 @@
|
||||
###
|
||||
# ==++==
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
###
|
||||
@{
|
||||
GUID = "4ae9fd46-338a-459c-8186-07f910774cb8"
|
||||
Author = "Microsoft Corporation"
|
||||
CompanyName = "Microsoft Corporation"
|
||||
Copyright = "(C) Microsoft Corporation. All rights reserved."
|
||||
HelpInfoUri = "http://go.microsoft.com/fwlink/?linkid=392040"
|
||||
ModuleVersion = "1.0.0.1"
|
||||
PowerShellVersion = "3.0"
|
||||
ClrVersion = "4.0"
|
||||
RootModule = "Microsoft.PowerShell.PackageManagement.dll"
|
||||
Description = 'PackageManagement (a.k.a. OneGet) is a new way to discover and install software packages from around the web.
|
||||
It is a manager or multiplexor of existing package managers (also called package providers) that unifies Windows package management with a single Windows PowerShell interface. With PackageManagement, you can do the following.
|
||||
- Manage a list of software repositories in which packages can be searched, acquired and installed
|
||||
- Discover software packages
|
||||
- Seamlessly install, uninstall, and inventory packages from one or more software repositories'
|
||||
|
||||
CmdletsToExport = @(
|
||||
'Find-Package',
|
||||
'Get-Package',
|
||||
'Get-PackageProvider',
|
||||
'Get-PackageSource',
|
||||
'Install-Package',
|
||||
'Import-PackageProvider'
|
||||
'Find-PackageProvider'
|
||||
'Install-PackageProvider'
|
||||
'Register-PackageSource',
|
||||
'Set-PackageSource',
|
||||
'Unregister-PackageSource',
|
||||
'Uninstall-Package'
|
||||
'Save-Package'
|
||||
)
|
||||
|
||||
FormatsToProcess = @('PackageManagement.format.ps1xml')
|
||||
|
||||
PrivateData = @{
|
||||
PSData = @{
|
||||
Tags = @('PackageManagement')
|
||||
ProjectUri = 'https://oneget.org'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,382 @@
|
||||
###
|
||||
# ==++==
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
###
|
||||
|
||||
<#
|
||||
Overrides the default Write-Debug so that the output gets routed back thru the
|
||||
$request.Debug() function
|
||||
#>
|
||||
function Write-Debug {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $message,
|
||||
[parameter(ValueFromRemainingArguments=$true)]
|
||||
[object[]]
|
||||
$args= @()
|
||||
)
|
||||
|
||||
if( -not $request ) {
|
||||
if( -not $args ) {
|
||||
Microsoft.PowerShell.Utility\write-verbose $message
|
||||
return
|
||||
}
|
||||
|
||||
$msg = [system.string]::format($message, $args)
|
||||
Microsoft.PowerShell.Utility\write-verbose $msg
|
||||
return
|
||||
}
|
||||
|
||||
if( -not $args ) {
|
||||
$null = $request.Debug($message);
|
||||
return
|
||||
}
|
||||
$null = $request.Debug($message,$args);
|
||||
}
|
||||
|
||||
function Write-Error {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $Message,
|
||||
[Parameter()][string] $Category,
|
||||
[Parameter()][string] $ErrorId,
|
||||
[Parameter()][string] $TargetObject
|
||||
)
|
||||
|
||||
$null = $request.Warning($Message);
|
||||
}
|
||||
|
||||
<#
|
||||
Overrides the default Write-Verbose so that the output gets routed back thru the
|
||||
$request.Verbose() function
|
||||
#>
|
||||
|
||||
function Write-Progress {
|
||||
param(
|
||||
[CmdletBinding()]
|
||||
|
||||
[Parameter(Position=0)]
|
||||
[string]
|
||||
$Activity,
|
||||
|
||||
# This parameter is not supported by request object
|
||||
[Parameter(Position=1)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]
|
||||
$Status,
|
||||
|
||||
[Parameter(Position=2)]
|
||||
[ValidateRange(0,[int]::MaxValue)]
|
||||
[int]
|
||||
$Id,
|
||||
|
||||
[Parameter()]
|
||||
[int]
|
||||
$PercentComplete=-1,
|
||||
|
||||
# This parameter is not supported by request object
|
||||
[Parameter()]
|
||||
[int]
|
||||
$SecondsRemaining=-1,
|
||||
|
||||
# This parameter is not supported by request object
|
||||
[Parameter()]
|
||||
[string]
|
||||
$CurrentOperation,
|
||||
|
||||
[Parameter()]
|
||||
[ValidateRange(-1,[int]::MaxValue)]
|
||||
[int]
|
||||
$ParentID=-1,
|
||||
|
||||
[Parameter()]
|
||||
[switch]
|
||||
$Completed,
|
||||
|
||||
# This parameter is not supported by request object
|
||||
[Parameter()]
|
||||
[int]
|
||||
$SourceID,
|
||||
|
||||
[object[]]
|
||||
$args= @()
|
||||
)
|
||||
|
||||
$params = @{}
|
||||
|
||||
if ($PSBoundParameters.ContainsKey("Activity")) {
|
||||
$params.Add("Activity", $PSBoundParameters["Activity"])
|
||||
}
|
||||
|
||||
if ($PSBoundParameters.ContainsKey("Status")) {
|
||||
$params.Add("Status", $PSBoundParameters["Status"])
|
||||
}
|
||||
|
||||
if ($PSBoundParameters.ContainsKey("PercentComplete")) {
|
||||
$params.Add("PercentComplete", $PSBoundParameters["PercentComplete"])
|
||||
}
|
||||
|
||||
if ($PSBoundParameters.ContainsKey("Id")) {
|
||||
$params.Add("Id", $PSBoundParameters["Id"])
|
||||
}
|
||||
|
||||
if ($PSBoundParameters.ContainsKey("ParentID")) {
|
||||
$params.Add("ParentID", $PSBoundParameters["ParentID"])
|
||||
}
|
||||
|
||||
if ($PSBoundParameters.ContainsKey("Completed")) {
|
||||
$params.Add("Completed", $PSBoundParameters["Completed"])
|
||||
}
|
||||
|
||||
if( -not $request ) {
|
||||
if( -not $args ) {
|
||||
Microsoft.PowerShell.Utility\Write-Progress @params
|
||||
return
|
||||
}
|
||||
|
||||
$params["Activity"] = [system.string]::format($Activity, $args)
|
||||
Microsoft.PowerShell.Utility\Write-Progress @params
|
||||
return
|
||||
}
|
||||
|
||||
if( -not $args ) {
|
||||
$request.Progress($Activity, $Status, $Id, $PercentComplete, $SecondsRemaining, $CurrentOperation, $ParentID, $Completed)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Write-Verbose{
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $message,
|
||||
[parameter(ValueFromRemainingArguments=$true)]
|
||||
[object[]]
|
||||
$args= @()
|
||||
)
|
||||
|
||||
if( -not $request ) {
|
||||
if( -not $args ) {
|
||||
Microsoft.PowerShell.Utility\write-verbose $message
|
||||
return
|
||||
}
|
||||
|
||||
$msg = [system.string]::format($message, $args)
|
||||
Microsoft.PowerShell.Utility\write-verbose $msg
|
||||
return
|
||||
}
|
||||
|
||||
if( -not $args ) {
|
||||
$null = $request.Verbose($message);
|
||||
return
|
||||
}
|
||||
$null = $request.Verbose($message,$args);
|
||||
}
|
||||
|
||||
<#
|
||||
Overrides the default Write-Warning so that the output gets routed back thru the
|
||||
$request.Warning() function
|
||||
#>
|
||||
|
||||
function Write-Warning{
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $message,
|
||||
[parameter(ValueFromRemainingArguments=$true)]
|
||||
[object[]]
|
||||
$args= @()
|
||||
)
|
||||
|
||||
if( -not $request ) {
|
||||
if( -not $args ) {
|
||||
Microsoft.PowerShell.Utility\write-warning $message
|
||||
return
|
||||
}
|
||||
|
||||
$msg = [system.string]::format($message, $args)
|
||||
Microsoft.PowerShell.Utility\write-warning $msg
|
||||
return
|
||||
}
|
||||
|
||||
if( -not $args ) {
|
||||
$null = $request.Warning($message);
|
||||
return
|
||||
}
|
||||
$null = $request.Warning($message,$args);
|
||||
}
|
||||
|
||||
<#
|
||||
Creates a new instance of a PackageSource object
|
||||
#>
|
||||
function New-PackageSource {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $name,
|
||||
[Parameter(Mandatory=$true)][string] $location,
|
||||
[Parameter(Mandatory=$true)][bool] $trusted,
|
||||
[Parameter(Mandatory=$true)][bool] $registered,
|
||||
[bool] $valid = $false,
|
||||
[System.Collections.Hashtable] $details = $null
|
||||
)
|
||||
|
||||
return New-Object -TypeName Microsoft.PackageManagement.MetaProvider.PowerShell.PackageSource -ArgumentList $name,$location,$trusted,$registered,$valid,$details
|
||||
}
|
||||
|
||||
<#
|
||||
Creates a new instance of a SoftwareIdentity object
|
||||
#>
|
||||
function New-SoftwareIdentity {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $fastPackageReference,
|
||||
[Parameter(Mandatory=$true)][string] $name,
|
||||
[Parameter(Mandatory=$true)][string] $version,
|
||||
[Parameter(Mandatory=$true)][string] $versionScheme,
|
||||
[Parameter(Mandatory=$true)][string] $source,
|
||||
[string] $summary,
|
||||
[string] $searchKey = $null,
|
||||
[string] $fullPath = $null,
|
||||
[string] $filename = $null,
|
||||
[System.Collections.Hashtable] $details = $null,
|
||||
[System.Collections.ArrayList] $entities = $null,
|
||||
[System.Collections.ArrayList] $links = $null,
|
||||
[bool] $fromTrustedSource = $false,
|
||||
[System.Collections.ArrayList] $dependencies = $null,
|
||||
[string] $tagId = $null,
|
||||
[string] $culture = $null,
|
||||
[string] $destination = $null
|
||||
)
|
||||
return New-Object -TypeName Microsoft.PackageManagement.MetaProvider.PowerShell.SoftwareIdentity -ArgumentList $fastPackageReference, $name, $version, $versionScheme, $source, $summary, $searchKey, $fullPath, $filename , $details , $entities, $links, $fromTrustedSource, $dependencies, $tagId, $culture, $destination
|
||||
}
|
||||
|
||||
<#
|
||||
Creates a new instance of a SoftwareIdentity object based on an xml string
|
||||
#>
|
||||
function New-SoftwareIdentityFromXml {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $xmlSwidtag,
|
||||
[bool] $commitImmediately = $false
|
||||
)
|
||||
|
||||
return New-Object -TypeName Microsoft.PackageManagement.MetaProvider.PowerShell.SoftwareIdentity -ArgumentList $xmlSwidtag, $commitImmediately
|
||||
}
|
||||
|
||||
<#
|
||||
Creates a new instance of a DyamicOption object
|
||||
#>
|
||||
function New-DynamicOption {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][Microsoft.PackageManagement.MetaProvider.PowerShell.OptionCategory] $category,
|
||||
[Parameter(Mandatory=$true)][string] $name,
|
||||
[Parameter(Mandatory=$true)][Microsoft.PackageManagement.MetaProvider.PowerShell.OptionType] $expectedType,
|
||||
[Parameter(Mandatory=$true)][bool] $isRequired,
|
||||
[System.Collections.ArrayList] $permittedValues = $null
|
||||
)
|
||||
|
||||
if( -not $permittedValues ) {
|
||||
return New-Object -TypeName Microsoft.PackageManagement.MetaProvider.PowerShell.DynamicOption -ArgumentList $category,$name, $expectedType, $isRequired
|
||||
}
|
||||
return New-Object -TypeName Microsoft.PackageManagement.MetaProvider.PowerShell.DynamicOption -ArgumentList $category,$name, $expectedType, $isRequired, $permittedValues.ToArray()
|
||||
}
|
||||
|
||||
<#
|
||||
Creates a new instance of a Feature object
|
||||
#>
|
||||
function New-Feature {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $name,
|
||||
[System.Collections.ArrayList] $values = $null
|
||||
)
|
||||
|
||||
if( -not $values ) {
|
||||
return New-Object -TypeName Microsoft.PackageManagement.MetaProvider.PowerShell.Feature -ArgumentList $name
|
||||
}
|
||||
return New-Object -TypeName Microsoft.PackageManagement.MetaProvider.PowerShell.Feature -ArgumentList $name, $values.ToArray()
|
||||
}
|
||||
|
||||
<#
|
||||
Duplicates the $request object and overrides the client-supplied data with the specified values.
|
||||
#>
|
||||
function New-Request {
|
||||
param(
|
||||
[System.Collections.Hashtable] $options = $null,
|
||||
[System.Collections.ArrayList] $sources = $null,
|
||||
[PSCredential] $credential = $null
|
||||
)
|
||||
|
||||
return $request.CloneRequest( $options, $sources, $credential )
|
||||
}
|
||||
|
||||
function New-Entity {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $name,
|
||||
[Parameter(Mandatory=$true,ParameterSetName="role")][string] $role,
|
||||
[Parameter(Mandatory=$true,ParameterSetName="roles")][System.Collections.ArrayList]$roles,
|
||||
[string] $regId = $null,
|
||||
[string] $thumbprint= $null
|
||||
)
|
||||
|
||||
$o = New-Object -TypeName Microsoft.PackageManagement.MetaProvider.PowerShell.Entity
|
||||
$o.Name = $name
|
||||
|
||||
# support role as a NMTOKENS string or an array of strings
|
||||
if( $role ) {
|
||||
$o.Role = $role
|
||||
}
|
||||
if( $roles ) {
|
||||
$o.Roles = $roles
|
||||
}
|
||||
|
||||
$o.regId = $regId
|
||||
$o.thumbprint = $thumbprint
|
||||
return $o
|
||||
}
|
||||
|
||||
function New-Link {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $HRef,
|
||||
[Parameter(Mandatory=$true)][string] $relationship,
|
||||
[string] $mediaType = $null,
|
||||
[string] $ownership = $null,
|
||||
[string] $use= $null,
|
||||
[string] $appliesToMedia= $null,
|
||||
[string] $artifact = $null
|
||||
)
|
||||
|
||||
$o = New-Object -TypeName Microsoft.PackageManagement.MetaProvider.PowerShell.Link
|
||||
|
||||
$o.HRef = $HRef
|
||||
$o.Relationship =$relationship
|
||||
$o.MediaType =$mediaType
|
||||
$o.Ownership =$ownership
|
||||
$o.Use = $use
|
||||
$o.AppliesToMedia = $appliesToMedia
|
||||
$o.Artifact = $artifact
|
||||
|
||||
return $o
|
||||
}
|
||||
|
||||
function New-Dependency {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string] $providerName,
|
||||
[Parameter(Mandatory=$true)][string] $packageName,
|
||||
[string] $version= $null,
|
||||
[string] $source = $null,
|
||||
[string] $appliesTo = $null
|
||||
)
|
||||
|
||||
$o = New-Object -TypeName Microsoft.PackageManagement.MetaProvider.PowerShell.Dependency
|
||||
|
||||
$o.ProviderName = $providerName
|
||||
$o.PackageName =$packageName
|
||||
$o.Version =$version
|
||||
$o.Source =$source
|
||||
$o.AppliesTo = $appliesTo
|
||||
|
||||
return $o
|
||||
}
|
||||
Reference in new issue
Block a user