@@ -29,16 +29,18 @@ function Get-TargetResource
29
29
$AdminContentDatabaseName
30
30
)
31
31
32
- Write-Verbose " Checking for local SP Farm"
32
+ Write-Verbose - Message " Checking for local SP Farm"
33
33
34
- $session = Get-xSharePointAuthenticatedPSSession $InstallAccount
34
+ $session = Get-xSharePointAuthenticatedPSSession - Credential $InstallAccount
35
35
36
36
$result = Invoke-Command - Session $session - ScriptBlock {
37
37
try {
38
38
$spFarm = Get-SPFarm - ErrorAction SilentlyContinue
39
- } catch {}
39
+ } catch {
40
+ Write-Verbose - Message " Unable to detect local farm."
41
+ }
40
42
41
- if ($spFarm -eq $null ) {return @ { }}
43
+ if ($null -eq $spFarm ) {return @ { }}
42
44
43
45
$returnValue = @ {
44
46
FarmName = $spFarm.Name
@@ -79,45 +81,45 @@ function Set-TargetResource
79
81
$AdminContentDatabaseName
80
82
)
81
83
82
- $session = Get-xSharePointAuthenticatedPSSession $InstallAccount
84
+ $session = Get-xSharePointAuthenticatedPSSession - Credential $InstallAccount
83
85
84
- Write-Verbose " Creating new configuration database"
86
+ Write-Verbose - Message " Creating new configuration database"
85
87
Invoke-Command - Session $session - ArgumentList $PSBoundParameters - ScriptBlock {
86
88
$params = $args [0 ]
87
89
New-SPConfigurationDatabase - DatabaseName $params.FarmConfigDatabaseName `
88
90
- DatabaseServer $params.DatabaseServer `
89
- - Passphrase (ConvertTo-SecureString $params.Passphrase - AsPlainText - force) `
91
+ - Passphrase (ConvertTo-SecureString - String $params.Passphrase - AsPlainText - force) `
90
92
- FarmCredentials $params.FarmAccount `
91
93
- SkipRegisterAsDistributedCacheHost:$true `
92
94
- AdministrationContentDatabaseName $params.AdminContentDatabaseName
93
95
}
94
96
95
- Write-Verbose " Installing help collection"
97
+ Write-Verbose - Message " Installing help collection"
96
98
Invoke-Command - Session $session - ScriptBlock {
97
99
Install-SPHelpCollection - All
98
100
}
99
101
100
- Write-Verbose " Initialising farm resource security"
102
+ Write-Verbose - Message " Initialising farm resource security"
101
103
Invoke-Command - Session $session - ScriptBlock {
102
104
Initialize-SPResourceSecurity
103
105
}
104
106
105
- Write-Verbose " Installing farm services"
107
+ Write-Verbose - Message " Installing farm services"
106
108
Invoke-Command - Session $session - ScriptBlock {
107
109
Install-SPService
108
110
}
109
111
110
- Write-Verbose " Installing farm features"
112
+ Write-Verbose - Message " Installing farm features"
111
113
Invoke-Command - Session $session - ScriptBlock {
112
114
Install-SPFeature - AllExistingFeatures - Force
113
115
}
114
116
115
- Write-Verbose " Creating Central Administration Website"
117
+ Write-Verbose - Message " Creating Central Administration Website"
116
118
Invoke-Command - Session $session - ScriptBlock {
117
119
New-SPCentralAdministration - Port 9999 - WindowsAuthProvider NTLM
118
120
}
119
121
120
- Write-Verbose " Installing application content"
122
+ Write-Verbose - Message " Installing application content"
121
123
Invoke-Command - Session $session - ScriptBlock {
122
124
Install-SPApplicationContent
123
125
}
0 commit comments