powershell icon indicating copy to clipboard operation
powershell copied to clipboard

New-PnPList / Set-PnPList -EnableVersioning parameter sets wrong property

Open jasmeeners opened this issue 3 years ago • 2 comments

Notice

Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Invoke-PnPSiteTemplate or Get-PnPSiteTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/pnpframework/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/pnp/powershell/tree/master/src/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/pnp/pnpframework/issues

Reporting an Issue or Missing Feature

New-PnPList -EnableVersioning sets "EnableMinorVersions" Property to True Set-PnPList -EnableVersioning $false sets "EnableMinorVersions" Property to false Set-PnPList -EnableVersioning $true sets "EnableMInorVersions" Property to true

Expected behavior

New-PnPList -EnableVersioning sets "EnableVersioning" Property to True Set-PnPList -EnableVersioning $false sets "EnableVersioning" Property to false Set-PnPList -EnableVersioning $true sets "EnableVersioning" Property to true

Actual behavior

no -EnableVersioning parameter results in enableversioning = True

New-PnPList -Title 'Audits1' -Template 'DocumentLibrary' -EnableContentTypes -OnQuickLaunch -ErrorAction Stop Set-PnPList -Identity Audits1 -Description 'Audits1'

get-PnpList -Identity Audits1 | format-list -Property EnableVersioning,EnableMinorVersions, MajorVersionLimit, MajorWithMinorVersionsLimit, ForceCheckout, EnableModeration,Title,Description,ContentTypesEnabled,OnQuickLaunch

EnableVersionIng True

EnableMinorVersions False

MajorVersionLimit 500

MajorWithMinroVersionsLimit 0

ForceCheckout False

EnableMOderation False

Title Audits1

Description Audits 1

ContentTypesEnabled True

OnQuickLaunch True

Template

-EnableVersioning sets EnableMinorVersions to True

$list = 'Audits2'

EnableVersioning turns on EnableMInorVersions

New-PnPList -Title $list -Template 'DocumentLibrary' -EnableContentTypes -OnQuickLaunch -ErrorAction Stop -EnableVersioning Set-PnPList -Identity $list -Description $list

get-PnpList -Identity Audits1 | format-list -Property EnableVersioning,EnableMinorVersions, MajorVersionLimit, MajorWithMinorVersionsLimit, ForceCheckout, EnableModeration,Title,Description,ContentTypesEnabled,OnQuickLaunch

<# EnableVersioning : True EnableMinorVersions : True MajorVersionLimit : 500 MajorWithMinorVersionsLimit : 0 ForceCheckout : False EnableModeration : False Title : Audits2 Description : Audits2 ContentTypesEnabled : True OnQuickLaunch : True #>

Set-PnPList -EnableVersioning $false sets EnableMinorVersions to False

EnableVersionsing turns on EnableMInorVersions (new)

Set EnableVersioning $false

$list = 'Audits5'

New-PnPList -Title $list -Template 'DocumentLibrary' -EnableContentTypes -OnQuickLaunch -ErrorAction Stop -EnableVersioning Set-PnPList -Identity $list -Description $list -EnableVersioning $false

get-PnpList -Identity Audits1 | format-list -Property EnableVersioning,EnableMinorVersions, MajorVersionLimit, MajorWithMinorVersionsLimit, ForceCheckout, EnableModeration,Title,Description,ContentTypesEnabled,OnQuickLaunch

<# EnableVersioning : True EnableMinorVersions : False MajorVersionLimit : 500 MajorWithMinorVersionsLimit : 0 ForceCheckout : False EnableModeration : False Title : Audits1 Description : Audits1 ContentTypesEnabled : True OnQuickLaunch : True #>

Set-PnPList -EnableMinorVersions $false also sets EnableMInorVersions to False

$list = 'Audits5.1'

New-PnPList -Title $list -Template 'DocumentLibrary' -EnableContentTypes -OnQuickLaunch -ErrorAction Stop -EnableVersioning Set-PnPList -Identity $list -Description $list -EnableMinorVersions $false

get-PnpList -Identity Audits1 | format-list -Property EnableVersioning,EnableMinorVersions, MajorVersionLimit, MajorWithMinorVersionsLimit, ForceCheckout, EnableModeration,Title,Description,ContentTypesEnabled,OnQuickLaunch

<# EnableVersioning : True EnableMinorVersions : False MajorVersionLimit : 500 MajorWithMinorVersionsLimit : 0 ForceCheckout : False EnableModeration : False Title : Audits1 Description : Audits1 ContentTypesEnabled : True OnQuickLaunch : True

#>

Steps to reproduce behavior

see above

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable) 1.11.59

Which operating system/environment are you running PnP PowerShell on?

  • [x ] Windows
  • [ ] Linux
  • [ ] MacOS
  • [ ] Azure Cloud Shell
  • [ ] Azure Functions
  • [ ] Other : please specify

jasmeeners avatar Aug 30 '22 21:08 jasmeeners

I cannot reproduce the Set-PnPList issue using pnp powershell 1.11.73

image

jackpoz avatar Sep 14 '22 06:09 jackpoz

hi @jasmeeners , are you able to reproduce the issue, if so could you maybe provide some more details ? Like @jackpoz here, we couldn't repro the issue.

gautamdsheth avatar Sep 20 '22 18:09 gautamdsheth

Closing due to lack of response.

gautamdsheth avatar Sep 29 '22 07:09 gautamdsheth