Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Spektra Games · May 26 at 01:08 AM · multiplayercommunity

Create a Multiplayer Server Build with PowerShell

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

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

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
Comment
Spektra Games

People who like this

1 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Where in a player's account would it be best to store data related to a moderator's interactions with the player? 1 Answer

    Manual Game Session via groups 1 Answer

    PlayFabParty: proving 'host' role? 1 Answer

    Server cost for each game 1 Answer

    What is the best way to provide co-op sessions? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges