Skip to content
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

Sharepoint export provider Get-SPOSite uses deprecated parameter #1220

Closed
tkol2022 opened this issue Jul 18, 2024 · 1 comment · Fixed by #1309
Closed

Sharepoint export provider Get-SPOSite uses deprecated parameter #1220

tkol2022 opened this issue Jul 18, 2024 · 1 comment · Fixed by #1309
Assignees
Labels
enhancement This issue or pull request will add new or improve existing functionality
Milestone

Comments

@tkol2022
Copy link
Collaborator

tkol2022 commented Jul 18, 2024

💡 Summary

The Sharepoint export provider Powershell code that calls Get-SPOSite uses a parameter named "Detailed" which is both deprecated and unused by ScubaGear. It should be removed from the code. The same applies to the Get-PnPTenantSite cmdlet - that parameter is not used by ScubaGear in that context either. I tested the code with the parameter removed to ensure that the tool behaves as expected.

image

image

Code Fix

Make the following change to the Sharepoint provider. You will notice that I removed the Detailed parameter from the calls to the respective cmdlets.

if ($PnPFlag) {
        $SPOTenant = ConvertTo-Json @($Tracker.TryCommand("Get-PnPTenant"))
        $SPOSite = ConvertTo-Json @($Tracker.TryCommand("Get-PnPTenantSite",@{"Identity"="$($SPOSiteIdentity)";}) | Select-Object -Property *)
        $Tracker.AddSuccessfulCommand("Get-SPOTenant")
        $Tracker.AddSuccessfulCommand("Get-SPOSite")
        $UsedPnP = ConvertTo-Json $true
    }
    else {
        $SPOTenant = ConvertTo-Json @($Tracker.TryCommand("Get-SPOTenant"))
        $SPOSite = ConvertTo-Json @($Tracker.TryCommand("Get-SPOSite", @{"Identity"="$($SPOSiteIdentity)";}) | Select-Object -Property *)
        $Tracker.AddSuccessfulCommand("Get-PnPTenant")
        $Tracker.AddSuccessfulCommand("Get-PnPTenantSite")
    }
@tkol2022 tkol2022 added the enhancement This issue or pull request will add new or improve existing functionality label Jul 18, 2024
@schrolla schrolla added this to the Jellyfish milestone Jul 22, 2024
@schrolla
Copy link
Collaborator

Pair this fix with #1221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue or pull request will add new or improve existing functionality
Projects
None yet
3 participants