diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 index 8c9cfed9f..bcdea92f4 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 @@ -26,7 +26,10 @@ function Get-TargetResource [parameter(Mandatory = $true)] [System.String] - $AdminContentDatabaseName + $AdminContentDatabaseName, + + [System.UInt32] + $CentralAdministrationPort ) Write-Verbose -Message "Checking for local SP Farm" @@ -78,7 +81,10 @@ function Set-TargetResource [parameter(Mandatory = $true)] [System.String] - $AdminContentDatabaseName + $AdminContentDatabaseName, + + [System.UInt32] + $CentralAdministrationPort = 9999 ) $session = Get-xSharePointAuthenticatedPSSession -Credential $InstallAccount @@ -116,7 +122,7 @@ function Set-TargetResource Write-Verbose -Message "Creating Central Administration Website" Invoke-Command -Session $session -ScriptBlock { - New-SPCentralAdministration -Port 9999 -WindowsAuthProvider NTLM + New-SPCentralAdministration -Port $params.CentralAdministrationPort -WindowsAuthProvider NTLM } Write-Verbose -Message "Installing application content" @@ -154,15 +160,17 @@ function Test-TargetResource [parameter(Mandatory = $true)] [System.String] - $AdminContentDatabaseName + $AdminContentDatabaseName, + + [System.UInt32] + $CentralAdministrationPort = 9999 ) - $result = Get-TargetResource -FarmConfigDatabaseName $FarmConfigDatabaseName -DatabaseServer $DatabaseServer -FarmAccount $FarmAccount -InstallAccount $InstallAccount -Passphrase $Passphrase -AdminContentDatabaseName $AdminContentDatabaseName + $result = Get-TargetResource -FarmConfigDatabaseName $FarmConfigDatabaseName -DatabaseServer $DatabaseServer -FarmAccount $FarmAccount -InstallAccount $InstallAccount -Passphrase $Passphrase -AdminContentDatabaseName $AdminContentDatabaseName -CentralAdministrationPort $CentralAdministrationPort if ($result.Count -eq 0) { return $false } return $true } -Export-ModuleMember -Function *-TargetResource - +Export-ModuleMember -Function *-TargetResource \ No newline at end of file diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.schema.mof index 7ec48e43b..d51f8626e 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.schema.mof @@ -8,5 +8,6 @@ class MSFT_xSPCreateFarm : OMI_BaseResource [Required, EmbeddedInstance("MSFT_Credential")] String InstallAccount; [Required] String Passphrase; [Required] String AdminContentDatabaseName; + [Write] uint32 CentralAdministrationPort; }; - +S \ No newline at end of file diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 799bb4f2d..abc62a768 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -10,12 +10,12 @@ function Get-xSharePointAuthenticatedPSSession() { [System.Boolean] $ForceNewSession = $false ) - - $session = @(Get-PSSession | Where-Object { $_.ComputerName -eq $env:COMPUTERNAME -and $_.Runspace.OriginalConnectionInfo.Credential.UserName -eq $Credential.UserName}) + $session = @(Get-PSSession | Where-Object { $_.ComputerName -eq "." -and $_.Runspace.OriginalConnectionInfo.Credential.UserName -eq $Credential.UserName -and $_.State -eq "Open"}) + if (($session.Count -eq 0) -or ($ForceNewSession -eq $true)) { Write-Verbose -Message "Creating new PowerShell session" - $session = New-PSSession -ComputerName $env:COMPUTERNAME -Credential $Credential -Authentication CredSSP + $session = New-PSSession -ComputerName "." -Credential $Credential -Authentication Credssp -SessionOption (New-PSSessionOption -OperationTimeout 600000 -SkipCACheck -SkipCNCheck -SkipRevocationCheck) Invoke-Command -Session $session -ScriptBlock { if ($null -eq (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)) { @@ -68,4 +68,14 @@ function Remove-xSharePointNullParamValues() { return $Params } +function Get-xSharePointAssemblyVerion() { + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true,Position=1)] + $PathToAssembly + ) + return (Get-Command $PathToAssembly).Version +} + Export-ModuleMember -Function * diff --git a/Modules/xSharePoint/xSharePoint.psd1 b/Modules/xSharePoint/xSharePoint.psd1 index 53f4c970d..88fa5fb42 100644 --- a/Modules/xSharePoint/xSharePoint.psd1 +++ b/Modules/xSharePoint/xSharePoint.psd1 @@ -12,19 +12,19 @@ # RootModule = '' # Version number of this module. -ModuleVersion = '0.4.0.0' +ModuleVersion = '0.3.1.0' # ID used to uniquely identify this module GUID = '6c1176a0-4fac-4134-8ca2-3fa8a21a7b90' -# Author of this module +# Author of this module Author = 'Microsoft Corporation' # Company or vendor of this module CompanyName = 'Microsoft Corporation' # Copyright statement for this module -Copyright = '(c) 2015 Microsoft Corporation. All rights reserved.' +Copyright = '(c) 2015 Microsoft Corporation. All rights reserved.' # Description of the functionality provided by this module Description = 'This DSC module is used to deploy and configure SharePoint Server 2013, and convers a wide range of areas including web apps, service apps and farm configuration.' diff --git a/README.md b/README.md index f76847e7e..1997490f4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Build status: [![Build status](https://ci.appveyor.com/api/projects/status/aj6ce04iy5j4qcd4/branch/master?svg=true)](https://ci.appveyor.com/project/PowerShell/xsharepoint/branch/master) +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PowerShell/xSharePoint?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + The xSharePoint PowerShell module provides DSC resources that can be used to deploy and manage a SharePoint farm. This module is provided AS IS, and is not supported through any Microsoft standard support program or service. @@ -71,7 +73,7 @@ Additional detailed documentation is included on the wiki on GitHub. ### 0.4.0.0 -* Fixed issue with nested modules’ cmdlets not being found +* Fixed issue with nested modules’ cmdlets not being found ### 0.3.0.0 diff --git a/appveyor.yml b/appveyor.yml index a91bf75fe..b35dd9b6d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.2.0.{build} +version: 0.3.1.{build} install: - cinst -y pester