1C Creating InfoBases via RAS

PowerShell script below:

$infobase = "base_name"

$sql_server_host = "sqlhost"
$sql_user_login = "sql_login"
$sql_user_password = "sql_password"

$odin_s_rac = '"C:\Program Files\1cv8\8.3.8.1652\bin\rac.exe"'
# --create-database

$cluster_id = . $odin_s_rac cluster list |
Select -first 1 |
ForEach-object { $_.Trim("cluster                       :") }

. $odin_s_rac infobase `
--cluster=$cluster_id create  `
--name=$infobase `
--dbms=MSSQLServer `
--db-server=$sql_server_host `
--db-name=$infobase `
--db-user=$sql_user_login `
--db-pwd=$sql_user_password `
--scheduled-jobs-deny=on `
--license-distribution=allow `
--locale=ru

$InfoBasePath = "Srvr=`"servername`";Ref=`"$($infobase)`";"

Write-Host $InfoBasePath

Write  $InfoBasePath | clip