<# .SYNOPSIS Deploy the p4ps1 suite to host. .DESCRIPTION This is a helper script that will deploy the Perforce Powershell and Active Directory wrapper library onto a host. It performs necessary additions to host configuration to properly support the script collection. .EXAMPLE Load the function with a . command, then run the script. c:\mydir>. .\p4ps1-init.ps1 c:\mydir>p4ps1-init -install This will locate and/or configure the following items required for integration. * Required libraries, such as Quest Powershell Additions * Script permissions * Sign the scripts * Locate and configure system environment variables * Configure the Powershell environment to load the scripts on startup of a Powershell session. * An initial Active Directory organizational unit and structure to support a Perforce server .EXAMPLE You can remove the environment variables and configuration .PARAMETER server Perforce server dns name .PARAMETER port Port that the Perforce server is listening on .PARAMETER username Valid username for depot logon. This user should have super rights in the depot. .PARAMETER password Password for depot authentication. If this parameter is not supplied, it will be requested interactively. .FUNCTIONALITY This function should be used at the start of any session that will use ANY of the other p4 cmdlets. The following environment variables are also set: p4logincall perforceport p4server You may call these variables from the current session with the $env: function. For example: $env:p4server Returns the server that the function logged into. #> Function p4-deployinfrastructure { cls "This is an interactive script designed to ease deployment of the Perforce <-> Active Directory integration toolset.`r`nPlease read the about p4toolset for more details." "`r`n`r`nYou need the following items to successfully complete this setup process:`r`n" "`t* Current session credentials have administrative rights:" "`t`t1. On the Windows server you will deploy to." "`t`t2. In Active Directory to create OU containers, users, groups, and modify their attributes." "`t* Perforce service:" "`t`t1. Is configured with at least one internal account with super access in protect." "`t`t2. Can be run as a service account that has Active Directory rights `r`n`t`t to LDAP users and groups concerning your Perforce deployment." "`t`t3. Is running on a Windows host that has a Powershell `r`n`t`t environment that behaves rationally." "`r`n" if ((read-host "Do you want to continue?[y/n]") -eq "y") { } else { "Install script terminated by user request." } }