cls
cd 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE'
# Указать путь к папке, куда будут выгружаться и откуда загружаться конфиги
$fld='C:\Temp'
# Указать Uri TFS коллекции
$srv='http://tfs:8080/tfs/CollectionName'
# Указать имена проектов (может быть один)
$projects=@('TFSProject1','TFSProject2')
if (!(Test-Path $fld)){
new-item -type directory -path $fld
}
write-host '[0] - Выгрузка всех конфигов (Categories, AgileProcessConfig, CommonConfiguration)'
write-host '-------------------------'
write-host '[1] - Выгрузка Categories'
write-host '[2] - Выгрузка AgileProcessConfig'
write-host '[3] - Выгрузка CommonConfiguration'
write-host '-------------------------'
write-host '[5] - Загрузка всех конфигов (Categories, AgileProcessConfig, CommonConfiguration)'
write-host '-------------------------'
write-host '[6] - Загрузка Categories'
write-host '[7] - Загрузка AgileProcessConfig'
write-host '[8] - Загрузка CommonConfiguration'
$action = read-host "Выберите действие: "
# Выгрузка шаблонов
foreach ($p in $projects)
{
write-host ' '
write-host '---------- '
write-host 'Проект ' -nonewline
write-host $p -nonewline -foregroundcolor Red
write-host '... '
write-host ' '
if ($action -eq '0')
{
write-host 'Выгрузка Categories ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportcategories /collection:$srv /p:$p /f:$fld"\["$p"]_categories.xml"
write-host 'Выгрузка AgileProcessConfig ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportagileprocessconfig /collection:$srv /p:$p /f:$fld"\["$p"]_AgileConfiguration.xml"
write-host 'Выгрузка CommonConfiguration ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportcommonprocessconfig /collection:$srv /p:$p /f:$fld"\["$p"]_CommonConfiguration.xml"
}
elseif ($action -eq '1')
{
write-host 'Выгрузка Categories ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportcategories /collection:$srv /p:$p /f:$fld"\["$p"]_categories.xml"
}
elseif ($action -eq '2')
{
write-host 'Выгрузка AgileProcessConfig ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportagileprocessconfig /collection:$srv /p:$p /f:$fld"\["$p"]_AgileConfiguration.xml"
}
elseif ($action -eq '3')
{
write-host 'Выгрузка CommonConfiguration ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportcommonprocessconfig /collection:$srv /p:$p /f:$fld"\["$p"]_CommonConfiguration.xml"
}
elseif ($action -eq '5')
{
write-host 'Загрузка Categories ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importcategories /collection:$srv /p:$p /f:$fld"\categories.xml"
write-host 'Загрузка AgileProcessConfig ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importagileprocessconfig /collection:$srv /p:$p /f:$fld"\AgileConfiguration.xml"
write-host 'Загрузка CommonConfiguration ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importcommonprocessconfig /collection:$srv /p:$p /f:$fld"\CommonConfiguration.xml"
}
elseif ($action -eq '6')
{
write-host 'Загрузка Categories ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importcategories /collection:$srv /p:$p /f:$fld"\categories.xml"
}
elseif ($action -eq '7')
{
write-host 'Загрузка AgileProcessConfig ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importagileprocessconfig /collection:$srv /p:$p /f:$fld"\AgileConfiguration.xml"
}
elseif ($action -eq '8')
{
write-host 'Загрузка CommonConfiguration ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importcommonprocessconfig /collection:$srv /p:$p /f:$fld"\CommonConfiguration.xml"
}
}
cd 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE'
# Указать путь к папке, куда будут выгружаться и откуда загружаться конфиги
$fld='C:\Temp'
# Указать Uri TFS коллекции
$srv='http://tfs:8080/tfs/CollectionName'
# Указать имена проектов (может быть один)
$projects=@('TFSProject1','TFSProject2')
if (!(Test-Path $fld)){
new-item -type directory -path $fld
}
write-host '[0] - Выгрузка всех конфигов (Categories, AgileProcessConfig, CommonConfiguration)'
write-host '-------------------------'
write-host '[1] - Выгрузка Categories'
write-host '[2] - Выгрузка AgileProcessConfig'
write-host '[3] - Выгрузка CommonConfiguration'
write-host '-------------------------'
write-host '[5] - Загрузка всех конфигов (Categories, AgileProcessConfig, CommonConfiguration)'
write-host '-------------------------'
write-host '[6] - Загрузка Categories'
write-host '[7] - Загрузка AgileProcessConfig'
write-host '[8] - Загрузка CommonConfiguration'
$action = read-host "Выберите действие: "
# Выгрузка шаблонов
foreach ($p in $projects)
{
write-host ' '
write-host '---------- '
write-host 'Проект ' -nonewline
write-host $p -nonewline -foregroundcolor Red
write-host '... '
write-host ' '
if ($action -eq '0')
{
write-host 'Выгрузка Categories ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportcategories /collection:$srv /p:$p /f:$fld"\["$p"]_categories.xml"
write-host 'Выгрузка AgileProcessConfig ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportagileprocessconfig /collection:$srv /p:$p /f:$fld"\["$p"]_AgileConfiguration.xml"
write-host 'Выгрузка CommonConfiguration ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportcommonprocessconfig /collection:$srv /p:$p /f:$fld"\["$p"]_CommonConfiguration.xml"
}
elseif ($action -eq '1')
{
write-host 'Выгрузка Categories ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportcategories /collection:$srv /p:$p /f:$fld"\["$p"]_categories.xml"
}
elseif ($action -eq '2')
{
write-host 'Выгрузка AgileProcessConfig ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportagileprocessconfig /collection:$srv /p:$p /f:$fld"\["$p"]_AgileConfiguration.xml"
}
elseif ($action -eq '3')
{
write-host 'Выгрузка CommonConfiguration ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin exportcommonprocessconfig /collection:$srv /p:$p /f:$fld"\["$p"]_CommonConfiguration.xml"
}
elseif ($action -eq '5')
{
write-host 'Загрузка Categories ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importcategories /collection:$srv /p:$p /f:$fld"\categories.xml"
write-host 'Загрузка AgileProcessConfig ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importagileprocessconfig /collection:$srv /p:$p /f:$fld"\AgileConfiguration.xml"
write-host 'Загрузка CommonConfiguration ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importcommonprocessconfig /collection:$srv /p:$p /f:$fld"\CommonConfiguration.xml"
}
elseif ($action -eq '6')
{
write-host 'Загрузка Categories ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importcategories /collection:$srv /p:$p /f:$fld"\categories.xml"
}
elseif ($action -eq '7')
{
write-host 'Загрузка AgileProcessConfig ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importagileprocessconfig /collection:$srv /p:$p /f:$fld"\AgileConfiguration.xml"
}
elseif ($action -eq '8')
{
write-host 'Загрузка CommonConfiguration ' -nonewline
write-host ' ' -nonewline -foregroundcolor Red
write-host ': ' -nonewline
.\witadmin importcommonprocessconfig /collection:$srv /p:$p /f:$fld"\CommonConfiguration.xml"
}
}
Комментариев нет:
Отправить комментарий