Examples/Install-WCM.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#requires -Version 5

Configuration IBMWCM
{
    param
    (
        [Parameter(Mandatory)]
        [PSCredential]
        $InstallCredential,
        
        [Parameter(Mandatory)]
        [PSCredential]
        $WebSphereAdminCredential
    )
    
    Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
    Import-DSCResource -ModuleName 'cIBMInstallationManager'
    Import-DSCResource -ModuleName 'cIBMWebSpherePortal'
    
    node localhost {
        Package SevenZip {
            Ensure = 'Present'
            Name = '7-Zip 9.20 (x64 edition)'
            ProductId = '23170F69-40C1-2702-0920-000001000000'
            Path = 'C:\Media\7z920-x64.msi'
        }
        cIBMInstallationManager IIMInstall
        {
            Ensure = 'Present'
            InstallationDirectory = 'C:\IBM\IIM'
            Version = '1.8.3'
            SourcePath = 'C:\Media\agent.installer.win32.win32.x86_1.8.3000.20150606_0047.zip'
            DependsOn = '[Package]SevenZip'
        }
        cIBMWebSpherePortal WPInstall
        {
            Ensure = 'Present'
            PortalEdition = 'WCM'
            HostName = 'localportal.domain.com'
            Version = '8.5.0.0'
            SourcePath = 'C:\Media\Portal85\'
            WebSphereAdministratorCredential = $WebSphereAdminCredential
            DependsOn = '[cIBMInstallationManager]IIMInstall'
            PsDscRunAsCredential = $InstallCredential
        }
    }
}
$configData = @{
    AllNodes = @(
        @{
            NodeName = "localhost"
            PSDscAllowPlainTextPassword = $true
         }
    )
}
$installCredential = (Get-Credential -UserName "Administrator" -Message "Enter the credentials of a Windows Administrator of the target server")
$wasAdminCredential = (Get-Credential -UserName "wsadmin" -Message "Enter the administrator credentials for the WebSphere Administrator")
IBMWCM -InstallCredential $installCredential -WebSphereAdminCredential $wasAdminCredential
Start-DscConfiguration -Wait -Force -Verbose IBMWCM