Skip to content

Commit

Permalink
Merge pull request #157 from microsoft/Dev
Browse files Browse the repository at this point in the history
1.0.0.744
  • Loading branch information
NikCharlebois authored Jul 20, 2019
2 parents abc511d + b186310 commit 927f7fe
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 17 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* BREAKING CHANGES
* O365Group
* ManagedBy is now a mandatory property
* SPOSite
* Owner is now a mandatory property
* Modules
* Added embedded Log Engine
* SCRetentionCompliancePolicy
Expand All @@ -18,3 +20,6 @@
* Initial Release
* SCSupervisoryReviewRule
* Initial Release
* SPOSite
* Added default value for Storage Quota
* Fixed an issue with site creation that could result in infinite loops
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Get-TargetResource
$GlobalAdminAccount
)

Write-Verbose -Message "GSetting configuration for app $Identity"
Write-Verbose -Message "Getting configuration for app $Identity"

$nullReturn = @{
Identity = ""
Expand Down
37 changes: 27 additions & 10 deletions Modules/Office365DSC/DSCResources/MSFT_SPOSite/MSFT_SPOSite.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function Get-TargetResource
[System.String]
$Url,

[Parameter()]
[Parameter(Mandatory = $true)]
[System.String]
$Owner,

Expand Down Expand Up @@ -269,13 +269,13 @@ function Set-TargetResource
[System.String]
$Url,

[Parameter()]
[Parameter(Mandatory = $true)]
[System.String]
$Owner,

[Parameter()]
[System.UInt32]
$StorageQuota,
$StorageQuota = 26214400,

[Parameter()]
[System.String]
Expand Down Expand Up @@ -453,13 +453,13 @@ function Test-TargetResource
[System.String]
$Url,

[Parameter()]
[Parameter(Mandatory = $true)]
[System.String]
$Owner,

[Parameter()]
[System.UInt32]
$StorageQuota,
$StorageQuota = 26214400,

[Parameter()]
[System.String]
Expand Down Expand Up @@ -637,6 +637,10 @@ function Export-TargetResource
[System.String]
$Url,

[Parameter(Mandatory = $true)]
[System.String]
$Owner,

[Parameter(Mandatory = $true)]
[System.String]
$CentralAdminUrl,
Expand Down Expand Up @@ -672,13 +676,13 @@ function Set-SPOSiteConfiguration
[System.String]
$Url,

[Parameter()]
[Parameter(Mandatory = $true)]
[System.String]
$Owner,

[Parameter()]
[System.UInt32]
$StorageQuota,
$StorageQuota = 26214400,

[Parameter()]
[System.String]
Expand Down Expand Up @@ -800,7 +804,11 @@ function Set-SPOSiteConfiguration

[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
$GlobalAdminAccount,

[Parameter()]
[System.Boolean]
$IsSecondTry = $false
)
Test-MSCloudLogin -ConnectionUrl $CentralAdminUrl `
-O365Credential $GlobalAdminAccount `
Expand Down Expand Up @@ -953,6 +961,7 @@ function Set-SPOSiteConfiguration
if ($CurrentParameters.ContainsKey("Template")) { $null = $CurrentParameters.Remove("Template") }
if ($CurrentParameters.ContainsKey("LocaleId")) { $null = $CurrentParameters.Remove("LocaleId") }
if ($CurrentParameters.ContainsKey("HubUrl")) { $null = $CurrentParameters.Remove("HubUrl") }
if ($CurrentParameters.ContainsKey("IsSecondTry")) { $null = $CurrentParameters.Remove("IsSecondTry") }
if ($CurrentParameters.Count -gt 0)
{
Set-SPOSite -Identity $Url @CurrentParameters -NoWait
Expand All @@ -972,7 +981,15 @@ function Set-SPOSiteConfiguration
Template = $Template
}
New-SPOSite @siteCreation
$CurrentParameters4Config = $PSBoundParameters
Set-SPOSiteConfiguration @CurrentParameters4Config

if (-not $IsSecondTry)
{
$CurrentParameters4Config = $PSBoundParameters
Set-SPOSiteConfiguration @CurrentParameters4Config -IsSecondTry $true
}
else
{
throw "There was an error trying to create SPOSite $Url"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
class MSFT_SPOSite : OMI_BaseResource
{
[Key, Description("The URL of the site collection")] string Url;
[Write, Description("The username of the site collection administrator")] string Owner;
[Write, Description("The resource quota to apply to the site collection")] uint32 StorageQuota;
[Key, Description("The username of the site collection administrator")] string Owner;
[Write, Description("The resource quota to apply to the site collection. Default value is 26214400")] uint32 StorageQuota;
[Write, Description("The title of the site")] string Title;
[Write, Description("The compatibility level of the site")] uint32 CompatibilityLevel;
[Write, Description("The locale code of the site")] uint32 LocaleId;
Expand Down
1 change: 1 addition & 0 deletions Modules/Office365DSC/Modules/O365DSCReverse.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ function Start-O365ConfigurationExtract
{
Write-Information " - [$i/$($sites.Length)] $($site.Url)"
$partialContent = Export-TargetResource -Url $site.Url `
-Owner "Reverse" `
-CentralAdminUrl $centralAdminUrl `
-GlobalAdminAccount $GlobalAdminAccount

Expand Down
4 changes: 2 additions & 2 deletions Modules/Office365DSC/Office365DSC.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '1.0.0.733'
ModuleVersion = '1.0.0.744'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -56,7 +56,7 @@
@{ModuleName = "Microsoft.Online.SharePoint.PowerShell"; RequiredVersion = "16.0.8316.0"; },
@{ModuleName = "MicrosoftTeams"; RequiredVersion = "1.0.0"; },
@{ModuleName = "AzureAD"; RequiredVersion = "2.0.2.4"; },
@{ModuleName = "MSCloudLoginAssistant"; RequiredVersion = "0.5.5"; })
@{ModuleName = "MSCloudLoginAssistant"; RequiredVersion = "0.5.6"; })

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
Expand Down
22 changes: 22 additions & 0 deletions Tests/Integration/O365Integration.Master.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,28 @@ Configuration Master
DependsOn = "[O365User]JohnSmith"
}

SPOSite ClassicSite
{
Title = "Classic Site"
Url = "https://o365dsc.sharepoint.com/sites/Classic"
Owner = "[email protected]"
Template = "STS#0"
CentralAdminUrl = "https://o365dsc-admin.sharepoint.com"
GlobalAdminAccount = $GlobalAdmin
Ensure = "Present"
}

SPOSite ModernSite
{
Title = "Modern Site"
Url = "https://o365dsc.sharepoint.com/sites/Modern"
Owner = "[email protected]"
Template = "STS#3"
CentralAdminUrl = "https://o365dsc-admin.sharepoint.com"
GlobalAdminAccount = $GlobalAdmin
Ensure = "Present"
}

TeamsTeam TeamAlpha
{
DisplayName = "Alpha Team"
Expand Down
1 change: 1 addition & 0 deletions Tests/Unit/Office365DSC/Office365DSC.SPOSite.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
$testParams = @{
Url = "https://contoso.com/sites/TestSite"
CentralAdminUrl = "https://contoso-admin.sharepoint.com"
Owner = "[email protected]"
GlobalAdminAccount = $GlobalAdminAccount
}

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ install:
Install-Module MSOnline -RequiredVersion 1.1.183.17 -Force
Install-Module MicrosoftTeams -RequiredVersion 1.0.0 -Force
Install-Module SharePointPnPPowerShellOnline -RequiredVersion 3.11.1907.0 -Force
Install-Module MSCloudLoginAssistant -RequiredVersion 0.5.5 -Force
Install-Module MSCloudLoginAssistant -RequiredVersion 0.5.6 -Force
$webClient = new-object System.Net.WebClient
$url = "https://github.com/Microsoft/Office365DSC/blob/Dev/Tests/Dependencies/SharePointOnlineManagementShell_8615-1200_x64_en-us.msi?raw=true"
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ steps:
inputs:
targetType: 'inline'
failOnStderr: true
script: Install-Module Microsoft.Online.SharePoint.PowerShell -RequiredVersion "16.0.8316.0" -Force;Install-Module AzureAD -RequiredVersion "2.0.2.4" -Force; Install-Module MicrosoftTeams -RequiredVersion "1.0.0" -Force;Install-Module SharePointPnPPowerShellOnline -RequiredVersion "3.11.1907.0" -Force;Install-Module MSOnline -Force;Install-Module ReverseDSC -Requiredversion "1.9.4.4" -Force;Install-Module MSCloudLoginAssistant -Force -RequiredVersion "0.5.5";Import-Module '$(build.artifactstagingdirectory)\BuildFiles\Tests\TestHarness.psm1' -Force;Invoke-TestHarness
script: Install-Module Microsoft.Online.SharePoint.PowerShell -RequiredVersion "16.0.8316.0" -Force;Install-Module AzureAD -RequiredVersion "2.0.2.4" -Force; Install-Module MicrosoftTeams -RequiredVersion "1.0.0" -Force;Install-Module SharePointPnPPowerShellOnline -RequiredVersion "3.11.1907.0" -Force;Install-Module MSOnline -Force;Install-Module ReverseDSC -Requiredversion "1.9.4.4" -Force;Install-Module MSCloudLoginAssistant -Force -RequiredVersion "0.5.6";Import-Module '$(build.artifactstagingdirectory)\BuildFiles\Tests\TestHarness.psm1' -Force;$results = Invoke-TestHarness; if ($results.FailedCount -gt 0){throw "Unit Test Failed"}
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Expand Down

0 comments on commit 927f7fe

Please sign in to comment.