简体   繁体   English

XenDesktop创建目录

[英]XenDesktop create Catalog

Hi I'm using a script made by me and I try to use it to create a catalog in XenDesktop. 嗨,我使用的是我自己编写的脚本,我尝试使用它在XenDesktop中创建目录。 And I don't know what is the error, really the XD answer say me that the error is to made 'random' the catalog, but, writing it there isn't any error. 而且我不知道这是什么错误,实际上XD回答告诉我,该错误是使目录“随机”生成的,但是编写该文件没有任何错误。

I left the code 我离开了代码

#
# CrearCatalogo.ps1
#

#Coger variables
[CmdletBinding()]
Param(
  [Parameter(Mandatory=$True,Position=1)]
   [string]$nombreCatalogo,
        [Parameter(Mandatory=$True)]
   [string]$tipoCatalogo,
        [Parameter(Mandatory=$True)]
   [string]$PVD
)

#Lanzar orden
$result = New-BrokerCatalog -name '$nombreCatalogo' -AllocationType '$tipoCatalogo' -MachinesArePhysical $false -ProvisioningType 'MCS' -SessionSupport 'SingleSession' -PersistUserChanges '$PVD' -AdminAddress "localhost:80"

   #Parsear

Now the error message (-AllocationType is the clue??) 现在出现错误信息(-AllocationType是线索?)

New-BrokerCatalog : No se puede enlazar el parámetro 'AllocationType'. New-BrokerCatalog:没有设置“ AllocationType”。 No se pu ede convertir el valor "$tipoCatalogo" al tipo "Citrix.Broker.Admin.SDK.Allocat ionType" porque hay valores no válidos en la enumeración. 没有价值转换工具“ $ tipoCatalogo”或“ Citrix.Broker.Admin.SDK.Allocat ionType”,没有任何价值。 Especifique uno de lo s valores de enumeración siguientes e inténtelo de nuevo. 虚幻的虚幻的世界观。 Los valores de enumer ación posibles son "Permanent, Static, Random". 儿子的“永久的,静态的,随机的”儿子。 En C:\\scripts\\CrearGrupoEscritorios\\01CrearCatalogo.ps1: 17 Carácter: 68 + $result = New-BrokerCatalog -name '$nombreCatalogo' -AllocationType <<<< '$t ipoCatalogo' -MachinesArePhysical $false -ProvisioningType 'MCS' -SessionSuppor t 'SingleSession' -PersistUserChanges '$PVD' -AdminAddress "localhost:80" + CategoryInfo : InvalidArgument: (:) [New-BrokerCatalog], Parame terBindingException C:\\ scripts \\ CrearGrupoEscritorios \\ 01CrearCatalogo.ps1:17份:68 + $ result = New-BrokerCatalog -name'$ nombreCatalogo'-AllocationType <<<<'$ t ipoCatalogo'-MachinesArePhysical $ false -ProvisioningType'MCS'- SessionSuppor t'SingleSession'-PersistUserChanges'$ PVD'-AdminAddress“ localhost:80” + CategoryInfo:InvalidArgument:(:) [New-BrokerCatalog],参数terBindingException

Thanks 谢谢

OK, I investigate this days and this is the solution 好,我这几天进行调查,这就是解决方案

#Coger variables
[CmdletBinding()]
Param(
  [Parameter(Mandatory=$True,Position=1)]
   [string]$nombreCatalogo,
    [Parameter(Mandatory=$True)]
   [Citrix.Broker.Admin.SDK.AllocationType]$tipoCatalogo,
    [Parameter(Mandatory=$True)]
   [string]$PVD
)

#Lanzar orden
New-BrokerCatalog –name "$nombreCatalogo" -AllocationType "$tipoCatalogo" –MachinesArePhysical $false –ProvisioningType 'MCS' –SessionSupport 'SingleSession' –PersistUserChanges "$PVD" -AdminAddress "localhost:80"

#Parsear 

First change $tipoCatalogo class from string to Citrix.Broker.Admin.SDK.AllocationType and change ' to " in variables in the script command. And finally delete $result variable 首先将$ tipoCatalogo类从字符串更改为Citrix.Broker.Admin.SDK.AllocationType,然后在脚本命令的变量中将'更改为'。最后删除$ result变量

Thanks for reading 谢谢阅读

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM