2021-04-27 16:04:12 +00:00
|
|
|
if( -not (Get-Command -ListImported Join-String -ErrorAction SilentlyContinue) ) {
|
2021-03-06 23:10:28 +00:00
|
|
|
if( -not (Get-Module -ListAvailable -Name "string") ) {
|
2021-10-29 17:31:24 +00:00
|
|
|
Write-Warning 'Join-String Command is missing, attempting to install string module'
|
2021-03-06 23:10:28 +00:00
|
|
|
$local:moduleScope = "CurrentUser"
|
|
|
|
if( Test-IsAdmin ) { $moduleScope = "AllUsers" }
|
|
|
|
Install-Module -Name "string" -Scope $moduleScope -AllowClobber -ErrorAction SilentlyContinue
|
|
|
|
}
|
|
|
|
if( -not (Get-Module -ListAvailable -Name "string") ) {
|
|
|
|
Write-Error "Failed to locate/install the module 'string'"
|
|
|
|
}
|
|
|
|
Import-Module -Name "string" -Cmdlet "Join-String"
|
2021-10-29 17:31:24 +00:00
|
|
|
}
|