s3.o365.psm1
#Requires -Version 5.1 #Requires -Modules PowerShellGet #Requires -Modules SharePointPnPPowerShellOnline $moduleName = "SharePointPnPPowerShellOnline" if (!(Get-command -Module $moduleName).count -gt 0) { Install-Module $moduleName -Force -SkipPublisherCheck } Write-Output "The modules for $moduleVersion have been installed and can now be used." function Set-S3SPWebOnline { [CmdletBinding(SupportsShouldProcess, ConfirmImpact='Medium')] Param( [Parameter(Mandatory=$true)] [string] $Url, [bool] $WithDemo ) if ($PSCmdlet.ShouldProcess("ShouldProcess?")) { # Critical code } Connect-PnPOnline $Url -UseWebLogin -RetryCount 500 -RetryWait 5 -RequestTimeout 360000000 $filePath = "$(SPlit-Path $script:MyInvocation.MyCommand.Path)\s3.o365.pnp" Apply-PnPProvisioningTemplate -Path $filePath } Export-ModuleMember -Function Set-S3SPWebOnline |