I am trying to creating a build that using Windows operating system and Process server type. But I am getting some errors when running ps1 script. Where am i doing wrong?
My ps1 script:
[string] $ZipName = "server_25_05_2022_12_17_42.zip" [string] $BuildNameWithExtension = "server.exe" Set-PfTitle -TitleID "MY_TITLE_ID" -SecretKey "MY_SECRET_KEY" $vmSize = "Standard_D2as_v4" $regions = @( @{ StandbyServers = 1; MaxServers = 1; Region = 'EastUS'; ScheduledStandbySettings = $NULL } ) $ports = @( @{ Name = 'game_port'; Protocol = 'UDP' }) $gameAssets = @( @{ FileName = $ZipName } ) $request = @{ BuildName = 'Test'; GameAssetReferences = $gameAssets; MultiplayerServerCountPerVm = 1; Ports = $ports; RegionConfigurations = $regions; StartMultiplayerServerCommand = $BuildNameWithExtension} $buildResponse = New-PfBuild -BuildName Test -CreateBuildWithProcessBasedServerRequest $request -ContainerFlavor ManagedWindowsServerCore -StartMultiplayerServerCommand $BuildNameWithExtension -GameAssetReferences $gameAssets -VMSize $vmSize -MultiplayerServerCountPerVM 1 -Ports $ports -RegionConfigurations $regions $buildResponse | ConvertTo-Json -depth 5
The error I got:
PS C:\Users\yusuf\Desktop\ParkingMasterMultiplayer_2\PlayFabMultiplayerPSScripts> ./test.ps1 code status data ---- ------ ---- 200 OK @{EntityToken=NHxIYmFuRjdsL2V2NzJiUGpRcWpVSU9QZkRqdWFYVmJUVWFWZ2ZzUUppVHhrPXx7ImkiOiIyMDIyLTA1LTI1VDEwOj... New-PfBuild : Parameter set cannot be resolved using the specified named parameters. At C:\Users\yusuf\Desktop\ParkingMasterMultiplayer_2\PlayFabMultiplayerPSScripts\test.ps1:12 char:18 + ... dResponse = New-PfBuild -BuildName Test -CreateBuildWithProcessBasedS ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-PfBuild], ParameterBindingException + FullyQualifiedErrorId : AmbiguousParameterSet,New-PfBuild
Line 12:
$buildResponse = New-PfBuild -BuildName Test -CreateBuildWithProcessBasedServerRequest $request -ContainerFlavor ManagedWindowsServerCore -StartMultiplayerServerCommand $BuildNameWithExtension -GameAssetReferences $gameAssets -VMSize $vmSize -MultiplayerServerCountPerVM 1 -Ports $ports -RegionConfigurations $regions
Answer by Gosen Gao · May 26 at 05:40 AM
Please refer to CREATEBUILDWITHPROCESSBASEDSERVERREQUEST : Creates a multiplayer server build with the game server running as a process and returns information about the build creation request which shows all available parameters related to CREATEBUILDWITHPROCESSBASEDSERVERREQUEST. For the current request, you can refer to the code below.
[string] $ZipName = "server_25_05_2022_12_17_42.zip" [string] $BuildNameWithExtension = "server.exe" Set-PfTitle -TitleID "MY_TITLE_ID" -SecretKey "MY_SECRET_KEY" $vmSize = "Standard_D2as_v4" $regions = @( @{ StandbyServers = 0; MaxServers = 1; Region = 'EastUS'; ScheduledStandbySettings = $NULL } ) $ports = @( @{ Name = 'game_port'; Protocol = 'UDP' }) $gameAssets = @( @{ FileName = $ZipName } ) $request = @{ BuildName = 'Test'; GameAssetReferences = $gameAssets; MultiplayerServerCountPerVm = 1; Ports = $ports; RegionConfigurations = $regions; StartMultiplayerServerCommand = $BuildNameWithExtension; VMSize = $vmSize} New-PfBuild -CreateBuildWithProcessBasedServerRequest $request