Skip to content

Change casing of -IncludeXML #739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions help/Save-PSResource.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Saves resources (modules and scripts) from a registered repository onto the mach
### NameParameterSet
```
Save-PSResource [-Name] <String[]> [-Version <String>] [-Prerelease] [-Repository <String[]>]
[-Credential <PSCredential>] [-AsNupkg] [-IncludeXML] [-Path <String>] [-TrustRepository] [-SkipDependencyCheck] [-AuthenticodeCheck] [-PassThru] [-Quiet] [-WhatIf] [-Confirm] [<CommonParameters>]
[-Credential <PSCredential>] [-AsNupkg] [-IncludeXml] [-Path <String>] [-TrustRepository] [-SkipDependencyCheck] [-AuthenticodeCheck] [-PassThru] [-Quiet] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### InputObjectParameterSet
```
Save-PSResource [-InputObject] <PSResourceInfo> [-Credential <PSCredential>] [-AsNupkg]
[-IncludeXML] [-Path <String>] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-Quiet] [-WhatIf] [-Confirm] [<CommonParameters>]
[-IncludeXml] [-Path <String>] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-Quiet] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -50,7 +50,7 @@ Saves the Az module as a .nupkg file

### Example 4
```powershell
PS C:\> Save-PSResource Az -IncludeXML
PS C:\> Save-PSResource Az -IncludeXml
```
Saves the Az module and includes the PowerShellGet XML metadata

Expand Down Expand Up @@ -155,7 +155,7 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -IncludeXML
### -IncludeXml
Includes the PowerShellGet metadata XML (used to verify that PowerShellGet has installed a module).

```yaml
Expand Down
6 changes: 3 additions & 3 deletions help/en-US/PowerShellGet.dll-Help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2406,7 +2406,7 @@ PS C:\&gt; Get-PSResourceRepository
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>IncludeXML</maml:name>
<maml:name>IncludeXml</maml:name>
<maml:description>
<maml:para>Includes the PowerShellGet metadata XML (used to verify that PowerShellGet has installed a module).</maml:para>
</maml:description>
Expand Down Expand Up @@ -2594,7 +2594,7 @@ PS C:\&gt; Get-PSResourceRepository
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>IncludeXML</maml:name>
<maml:name>IncludeXml</maml:name>
<maml:description>
<maml:para>Includes the PowerShellGet metadata XML (used to verify that PowerShellGet has installed a module).</maml:para>
</maml:description>
Expand Down Expand Up @@ -2745,7 +2745,7 @@ PS C:\&gt; Get-PSResourceRepository
</command:example>
<command:example>
<maml:title>-------------------------- Example 4 --------------------------</maml:title>
<dev:code>PS C:\&gt; Save-PSResource Az -IncludeXML</dev:code>
<dev:code>PS C:\&gt; Save-PSResource Az -IncludeXml</dev:code>
<dev:remarks>
<maml:para>Saves the Az module and includes the PowerShellGet XML metadata</maml:para>
</dev:remarks>
Expand Down
12 changes: 6 additions & 6 deletions src/code/InstallHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ internal class InstallHelper : PSCmdlet
private bool _trustRepository;
private PSCredential _credential;
private bool _asNupkg;
private bool _includeXML;
private bool _includeXml;
private bool _noClobber;
private bool _authenticodeCheck;
private bool _savePkg;
Expand Down Expand Up @@ -78,14 +78,14 @@ public List<PSResourceInfo> InstallPackages(
bool noClobber,
PSCredential credential,
bool asNupkg,
bool includeXML,
bool includeXml,
bool skipDependencyCheck,
bool authenticodeCheck,
bool savePkg,
List<string> pathsToInstallPkg)
{
_cmdletPassedIn.WriteVerbose(string.Format("Parameters passed in >>> Name: '{0}'; Version: '{1}'; Prerelease: '{2}'; Repository: '{3}'; " +
"AcceptLicense: '{4}'; Quiet: '{5}'; Reinstall: '{6}'; TrustRepository: '{7}'; NoClobber: '{8}'; AsNupkg: '{9}'; IncludeXML '{10}'; SavePackage '{11}'",
"AcceptLicense: '{4}'; Quiet: '{5}'; Reinstall: '{6}'; TrustRepository: '{7}'; NoClobber: '{8}'; AsNupkg: '{9}'; IncludeXml '{10}'; SavePackage '{11}'",
string.Join(",", names),
versionRange != null ? (versionRange.OriginalString != null ? versionRange.OriginalString : string.Empty) : string.Empty,
prerelease.ToString(),
Expand All @@ -96,7 +96,7 @@ public List<PSResourceInfo> InstallPackages(
trustRepository.ToString(),
noClobber.ToString(),
asNupkg.ToString(),
includeXML.ToString(),
includeXml.ToString(),
savePkg.ToString()));

_versionRange = versionRange;
Expand All @@ -110,7 +110,7 @@ public List<PSResourceInfo> InstallPackages(
_noClobber = noClobber;
_credential = credential;
_asNupkg = asNupkg;
_includeXML = includeXML;
_includeXml = includeXml;
_savePkg = savePkg;
_pathsToInstallPkg = pathsToInstallPkg;

Expand Down Expand Up @@ -557,7 +557,7 @@ private List<PSResourceInfo> InstallPackage(
// Delete the extra nupkg related files that are not needed and not part of the module/script
DeleteExtraneousFiles(pkgIdentity, tempDirNameVersion);

if (_includeXML)
if (_includeXml)
{
CreateMetadataXMLFile(tempDirNameVersion, installPath, pkg, isModule);
}
Expand Down
2 changes: 1 addition & 1 deletion src/code/InstallPSResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ private void ProcessInstallHelper(string[] pkgNames, VersionRange pkgVersion, bo
noClobber: NoClobber,
credential: pkgCredential,
asNupkg: false,
includeXML: true,
includeXml: true,
skipDependencyCheck: SkipDependencyCheck,
authenticodeCheck: AuthenticodeCheck,
savePkg: false,
Expand Down
4 changes: 2 additions & 2 deletions src/code/SavePSResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public sealed class SavePSResource : PSCmdlet
/// Saves the metadata XML file with the resource
/// </summary>
[Parameter]
public SwitchParameter IncludeXML { get; set; }
public SwitchParameter IncludeXml { get; set; }

/// <summary>
/// The destination where the resource is to be installed. Works for all resource types.
Expand Down Expand Up @@ -264,7 +264,7 @@ private void ProcessSaveHelper(string[] pkgNames, bool pkgPrerelease, string[] p
credential: Credential,
noClobber: false,
asNupkg: AsNupkg,
includeXML: IncludeXML,
includeXml: IncludeXml,
skipDependencyCheck: SkipDependencyCheck,
authenticodeCheck: AuthenticodeCheck,
savePkg: true,
Expand Down
2 changes: 1 addition & 1 deletion src/code/UpdatePSResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected override void ProcessRecord()
credential: Credential,
noClobber: false,
asNupkg: false,
includeXML: true,
includeXml: true,
skipDependencyCheck: SkipDependencyCheck,
authenticodeCheck: AuthenticodeCheck,
savePkg: false,
Expand Down
2 changes: 1 addition & 1 deletion test/SavePSResource.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Describe 'Test Save-PSResource for PSResources' {
}

It "Save module and include XML metadata file" {
Save-PSResource -Name $testModuleName -Version "1.0.0" -Repository $PSGalleryName -Path $SaveDir -IncludeXML -TrustRepository
Save-PSResource -Name $testModuleName -Version "1.0.0" -Repository $PSGalleryName -Path $SaveDir -IncludeXml -TrustRepository
$pkgDir = Get-ChildItem -Path $SaveDir | Where-Object Name -eq $testModuleName
$pkgDir | Should -Not -BeNullOrEmpty
$pkgDirVersion = Get-ChildItem -Path $pkgDir.FullName
Expand Down