GithubHelp home page GithubHelp logo

hjorslev / steamps Goto Github PK

View Code? Open in Web Editor NEW
66.0 2.0 14.0 1.78 MB

Module that utilizes PowerShell as a wrapper for SteamCMD and interacts with various Steam APIs.

Home Page: https://www.powershellgallery.com/packages/SteamPS

License: MIT License

PowerShell 100.00%
steam powershell-module steam-api steamcmd-api steamcmd-installation steamcmd-servers steamps

steamps's Introduction

SteamPS

GH Actions Codecov PS Gallery
GitHub Actions Workflow Status Codecov (with branch) PowerShell Gallery

Introduction

SteamPS is a PowerShell module that utilizes PowerShell as a wrapper for SteamCMD and interacts with various Steam APIs.

SteamPS is aimed at server administrators maintaining one or more servers. It can be used to install SteamCMD, update game servers, query Steam based game servers for server information and more.

Command Reference

Cmdlet Description
Connect-SteamAPI Create or update the Steam Web API config file.
Disconnect-SteamAPI Disconnects from the Steam API by removing the stored API key.
Get-SteamApp Retrieves the name and ID of a Steam application by searching the name or ID of the application.
Get-SteamFriendList Returns the friend list of any Steam user.
Get-SteamNews Returns the latest news of a game.
Get-SteamPlayerBan Returns Community, VAC, and Economy ban statuses for any given players.
Get-SteamPlayerSummary Returns basic profile information for a list of 64-bit Steam IDs.
Get-SteamServerInfo Query a running Steam based game server.
Install-SteamCMD Downloads and installs SteamCMD.
Resolve-VanityURL Resolve a vanity URL (also named custom URL).
Update-SteamApp Install or update a Steam application using SteamCMD.
Update-SteamServer Update a Steam based game server through a workflow.

Prerequisites

  • Windows based OS
  • Windows PowerShell 5.1 / PowerShell 7.

You can find your version of PowerShell by using:

$PSVersionTable.PSVersion

Getting Started

Install from PowerShell Gallery

The module is published in the PowerShell Gallery.

Run the following in an elevated prompt to install the module globally for all users on the server:

Install-Module -Name SteamPS

The module can also be installed in the current user's scope by adding -Scope CurrentUser to the above mentioned command. If multiple people are administrating the server, it can be easier to maintain the module by having SteamPS installed in just one location.

Furthermore, if you plan to have cmdlets from the module running unattended you will need to make sure that the module is available to the user running it. This can be achieved by ensuring the module is installed for the user running it, or just have it installed globally for all users as exemplified above.

When SteamPS is installed you will need to use the cmdlet Install-SteamCMD from the module to install SteamCMD. This is done by calling Install-SteamCMD from an elevated prompt:

Install-SteamCMD

Select application

By using the parameter -InstallPath you can specify an install location of SteamCMD. The default installation path is C:\Program Files\SteamCMD. The install path, default or custom, is added to the PATH.

Usage

Update single app / game server

The cmdlet Update-SteamApp is used to both install and/or update an application. You can either specify the name of the application or the application ID.

Install / Update using ApplicationName

If you enter e.g. Ground Branch as an application name you will see both the game itself as well as the dedicated server. You will have to select the correct application from the popup box.

Update-SteamApp -ApplicationName 'Ground Branch' -Path 'C:\DedicatedServers\GB'

Select application

You can narrow down the search by typing an application name that is more specific than simply Ground Branch e.g. Ground Branch Dedi or type it out in its entirety as Ground Branch Dedicated Server. This will only give one result and not display a popup.

Update-SteamApp -ApplicationName 'Ground Branch Dedicated Server' -Path 'C:\DedicatedServers\GB'

Select application

Install / Update using AppID

In this example we install ARK: SurvivalEvolved Dedicated Server by using its AppID. The AppID can be found by using a database such as Steam Database or by searching for the AppID with the cmdlet Get-SteamApp e.g. Get-SteamApp -ApplicationName 'Counter-Strike'.

Update-SteamApp -AppID 376030 -Path 'C:\DedicatedServers\ARK-SurvivalEvolved'

Authenticating

The two previous examples do not require authentication to install. However, some applications might require a Steam account. If that is the case, you will need to use the parameter -Credential to authenticate:

Update-SteamApp -ApplicationName 'Ground Branch Dedicated Server' -Path 'C:\DedicatedServers\GB' -Credential SAS_Admin

This will present you with an option to type in your password.

In case you need to authenticate and want to run the script unattended, avoid writing the password in plaintext in the script. See how this can be achieved: Store Credentials in PowerShell Script.

Update Steam server automatically

The cmdlet Update-SteamServer is, at least for my own use case, applied to automatically keep a server up to date. It will check if the server is empty before updating it. The script is configured as a Windows Task and runs very night.

Please see the wiki for further information: Update Steam server automatically.

Acknowledgements

Joystick icon by Delapouite. Available at game-icons.net.

steamps's People

Contributors

bitterbutt avatar elitecodexer avatar hjorslev avatar santisq avatar theposhwolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

steamps's Issues

Update-SteamServer requires admin

Describe "Module Bug or Issue"

Update-SteamServer needs to test if the user is admin.

Context "The Problem"

Update-SteamServer requires admin privileges to stop a service.

Context "Expected Behavior"

Update-SteamServer should throw an error if the user is not an admin.

Context "Additional Information"

Get-Module -Name SteamPS -ListAvailable |
    Select-Object -Property Name, Version

$PSVersionTable | Out-String

Get-SteamNews should return a PSObject

Describe "Functionality"

The cmdlet should return a PSObject with the response from the API.

Context "Private or Public? What are the use cases? Parameters? Options?"

  • Remove the parameter OutputFormat

Context "Additional Information"

Remake Find-SteamAppID to Get-SteamGame

Describe "Functionality"

Remake Find-SteamAppID to Get-SteamGame

Context "Private or Public? What are the use cases? Parameters? Options?"

Public cmdlet that have two parameters: ApplicationName and ApplicationID

It should also support cache so the data isn't downloaded every time the cmdlet is used.

Context "Additional Information"

Convert-SteamID: Cmdlet that can interact with a SteamID

Describe "Functionality"

A cmdlet that can convert SteamIDs to different formats such as https://steamid.io/

Context "Private or Public? What are the use cases? Parameters? Options?"

A steamID is a unique identifier used to identify a Steam account. A steamID can be converted to the newer steamID3 and to a steamID64, sometimes referred to as community ID or friendID. With this steamID64, a user's Steam community page can be found. A customURL is an optional, more personalised identifier to look up a user's Steam Community page with.

Context "Additional Information"

Login Info

Can you make it to where you can input the steam username and password in the ps command?

Get-SteamServerInfo always displays an error with Valheim server

Describe "Module Bug or Issue"

Whenever I use the Get-SteamServerInfo function against my self hosted Valheim server, it always displays an error.

Context "The Problem"

Get-SteamServerInfo -IPAddress <server ip> -Port <server port>

Error message:

MethodInvocationException: C:\Users\antwon\Documents\PowerShell\Modules\SteamPS\3.2.0\Private\Server\Get-PacketString.ps1:38
Line |
  38 |          [System.Text.Encoding]::UTF8.GetString($stringBytes)
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "GetString" with "1" argument(s): "Array cannot be null. (Parameter 'bytes')"

However, it does display information:

Protocol      : 17
ServerName    : <map name>
Map           : <map name>
InstallDir    : valheim
GameName      :
AppID         : 0
Players       : 0
MaxPlayers    : 10
Bots          : 0
ServerType    : Dedicated
Environment   : Windows
Visibility    : Private
VAC           : Unsecured
Version       : 1.0.0.0
ExtraDataFlag : 177
IPAddress     : <redacted>
Port          : <redacted>

Context "Expected Behavior"

I would expect it not to error.

Context "Additional Information"

Get-Module -Name SteamPS -ListAvailable |
>>     Select-Object -Property Name, Version

Name    Version
----    -------
SteamPS 3.2.0

$PSVersionTable | Out-String

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

I did also try this on Windows PowerShell 5.1, same error.

I believe the resolution to this is to simply add an if statement to line 38 on Get-PacketString:

        if ($stringBytes.Count -gt 0) {
            [System.Text.Encoding]::UTF8.GetString($stringBytes)
        }

Deprecate Windows PowerShell (v5)

Describe "Functionality"

Write warning when the module loads about the deprecation of Windows PowerShell.

Context "Private or Public? What are the use cases? Parameters? Options?"

Context "Additional Information"

Due to Linux compatibility and the use of features only available in pwsh.

Add cmdlets for Steam Web API

Describe "Functionality"

Add a cmdlet that can interact with each API as listed on Steam Web API.

Context "Private or Public? What are the use cases? Parameters? Options?"

Furthermore, there is a need of

  • Connect-SteamAPI
  • Get-SteamAPIKey (private cmdlet)
  • a cmdlet that can interact with a SteamID. Splitted into #32.

All cmdlets are to be placed in Public\API folder except Get-SteamAPIKey.

Parameters needed for each cmdlet are listed on Steam Web API as well. See for example GetFriendList (v0001) under Arguments.

Context "Additional Information"

  • Pester Tests are needed for each cmdlet. Splitted into #31.
  • Update module description as the scope becomes larger than only SteamCMD.
  • Refactor current cmdlets into sub folders.

Environment Enum interfers with [Environment]

Describe "Module Bug or Issue"

image

Context "The Problem"

Method invocation failed because [Environment] does not contain a method named 'GetEnvironmentVariable'.
At line:1 char:1
+ [Environment]::GetEnvironmentVariable("Path")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

This error occur sometimes. It seems to be linked with the Enum named Environment as shown in the screenshot above.

Context "Expected Behavior"

Should not throw an error. This can easily be fixed by renaming the Environment Enum to OSType or similar.

Context "Additional Information"

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.1.18362.752                                                                           
PSEdition                      Desktop                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.18362.752                                                                          
CLRVersion                     4.0.30319.42000                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1                                                                                 

Update-SteamServer throw errors if server is offline

Describe "Module Bug or Issue"

Errors are thrown in Update-SteamServer if Get-SteamServerInfo can't reach the server:

Get-SteamServerInfo : System.Exception: Could not reach server 185.15.73.207:27016.
At C:\Program Files\WindowsPowerShell\Modules\SteamPS\3.1.1\Public\Update-SteamServer.ps1:119 char:25
+ ... $ServerStatus = Get-SteamServerInfo -IPAddress $IPAddress -Port $Port
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ConnectionError: (:) [Get-SteamServerInfo], Exception
    + FullyQualifiedErrorId : ServerNotFound,Get-SteamServerInfo

Write-Log : Cannot bind argument to parameter 'Message' because it is an empty string.
At C:\Program Files\WindowsPowerShell\Modules\SteamPS\3.1.1\Public\Update-SteamServer.ps1:120 char:28
+         Write-Log -Message $ServerStatus
+                            ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Write-Log], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Write-Log

It could also look as if the log file is not created (#29).

Context "The Problem"

Consider how to proceed. Either

  1. update the server and the flow will automatically start the server after it is updated
    or
  2. don't proceed and send message to Discord (if configured)

Context "Expected Behavior"

Context "Additional Information"

Get-Module -Name SteamPS -ListAvailable |
    Select-Object -Property Name, Version

$PSVersionTable | Out-String

Disconnect-SteamAPI

Describe "Functionality"

The counterpart to Connect-SteamAPI.

Context "Private or Public? What are the use cases? Parameters? Options?"

The cmdlet should remove the stored API key.

Context "Additional Information"

SteamCMD parameter "validate" should not be default

Describe "Module Bug or Issue"

When using the parameter validate custom files might get overwritten. Validate is default behavior in SteamPS.

Context "The Problem"

Validate is a command that will check all the server files to make sure they match the SteamCMD files. This command is useful if you think that files may be missing or corrupted. Validation will overwrite any files that have been changed. This may cause issues with customized servers. For example, if you customize mapcycle.txt, this file will be overwritten to the server default. Any files that are not part of the default installation will not be affected.

It is recommended you use this command only on initial installation and if there are server issues.

Source: https://developer.valvesoftware.com/wiki/SteamCMD#Validate

Context "Expected Behavior"

Validate should instead be an optional parameter -Validate.

Support for more SteamCMD parameters

Describe "Functionality"

There is quite a few commands to SteamCMD:

api_logging : api_logging <enabled> <verbose> : enable/disable verbose API logging in steamcmd
app_build_all_depots : app_build_all_depots [-desc <text>] -depotconfigpath <folder> -contentroot <folder> -buildoutput <folder> <appid> : Build all depots for one app
app_dlc_status : app_status <appId> <dlcId>
app_info_print : Dumps app info for appID
app_info_request : <AppID> - Issue an appinfo request for the given appid. Does not wait for results from the server.
app_info_update : [0|1] : trigger app info update, optionally for update all
app_install_script : <AppID> [uninstall:0|1]- Runs app install script.
app_launch : <appId> [LaunchOptionIndex] [Arguments]
app_license_request : <AppID> - Requests a free licenses for this app if not already owned.
app_run : <appId> [LaunchOptionIndex] [Arguments]
app_set_config : <AppID> <key> <value> - sets a config value for given app.
app_set_update_flag : app_set_update_flag <appId>
app_status : app_status <appId>
app_stop : <appid> [force:0|1] stop this running app
app_uninstall : <appId>
app_update : app_update <appid> [-validate] [-language <lang>] [-beta <betaname>] [-betapassword <pwd>] make sure a Steam application is up-to-date
app_update_cancel : <EAppUpdateError>
apps_installed :
apps_running : displays information about running games tracked by Steam
async_disconnect : async disconnect
build_backup : <appid> <target folder> [max folder size MB]
build_installer : <project file> <target folder> [beta key] [beta pwd]
ceg_wrap : ceg_wrap <appid> <orig filename> <stripped filename> <strips filename> : upload executable to back end for CEG wrapping
cm_force_change : Change CM List
device_authorize_status : prints device authorization status
download_chunk : download_chunk <appid> <depotid> <sha>: download a single chunk from a depot
download_depot : download_depot <appid> <depotid> [<target manifestid>] [<delta manifestid>] [<depot flags filter>]: download a single depot
download_item : download_item <appid> <PublishedFileId> : download a workshop item directly
download_sources : Dumps list of download sources
drm_wrap : drm_wrap <appid> <input filename> <output filename> <toolname> <flags> : upload executable to back end for DRM wrapping
dump_box_ips : dump the list of detected local box IP addresses
dump_scheduled_functions : usage: "dump_scheduled_functions" Displays internal Steam function callback timers
exit : Stops Steam client console
find : find substrings in console commands
force_install_dir : force_install_dir <directory>
get_download_throttle :
help : Show help information
http_test : <optional_url> test HTTP connectivity via specified URL
info : Dump various Steam info
library_folder_list : list all mounted Steam volumes
licenses_for_app : <appid> : shows active licenses for appid
licenses_print : display users's Steam3 licenses
log_callbacks : usage: "log_callbacks <first callbackID> [last callbackID]
log_ipc : usage: "log_ipc [counts|verbose|#maxcount] <filter>" Enables IPC logging. Specifying "counts" or "verbose" is optional, defaulting to counts.
login : <username> [<password>] [<Steam guard code>] - login to Steam
logoff : Disconnect from Steam
logon : see 'login'
logout : Disconnect from Steam
manifest_dump : <filename> [0|1: include chunks]
mem_stats : Dump memory stats
net_msgdump : Dumps list of sent net messages
net_msgspew : Spews sent and recv net messages
p2p_info : usage: "p2p_info" Displays the current state of the P2P networking subsystem.
package_info_print : Dumps package info for packageID
profile : <seconds> profile for N seconds
quit : Stops Steam client console
render_ipc_connections : usage: "render_ipc_connections
run_app_build : run_app_build [-preview] [-desc <text>] <appbuildfile> : run app depot build as specified in appbuildfile
run_app_build_http : run_app_build_http : alias for run_app_build
runscript : <scriptfile> - runs a console command script
set_app_beta_password : set_app_beta_password <appid> -betapassword <pwd> -- opt-in to the app beta with the given password
set_download_throttle : set_download_throttle <kbps> <bPersistent = false>
set_spew : <group> <level> <loglevel> set spew levels for the given group
set_spew_level : <SpewLevel LogLevel> Sets spew and log level for all groups
set_steam_guard_code : <code> - authorize this computer by adding the Steam Guard email code
sign_install_script : sign_install_script <appid> <input filename> <output filename> : upload install script to back end for signing
swarm_get_bucket_manifest : <appid> <bucket_hw_id> <bucket_sw_id> - query Swarm bucket depot manifest, if depot built
swarm_tc_loop : <src_bucket_hw_id> <src_bucketsw_id> <dst_bucket_hw_id> <dst_bucket_sw_id> <work_dir> <tool_appid> <entrypoint> <src_file> <dst_file>
test_dropcon : Tests dropping a connection
test_failnextconnect : Tests failing the next connection
test_opus_voice_encode : test an opus voice encode
test_reconnect : Reconnect after using test_failnextconnect&test_dropcon
test_voice_encode : test a voice encode
timed_trial_add_playtime : timed_trial_add_playtime <appId> <seconds>: add trial app playtime (developer only)
timed_trial_reset_playtime : timed_trial_reset_playtime <appId> : reset trial app playtime (developer only)
timed_trial_status : timed_trial_status <appId> : show time trial app status
upload_controller_config : upload_controller_config <appid> <filename> : upload controller config to cloud
user_friends : Dumps list of friends
verify_chunk_store : verify_chunk_store <appid> <depotid> <datafile> : run app depot build as specified in appbuildfile
verify_vpk : verify_vpk <datafile> : verifies content of given VPK
voice_game_usage : displays information about the game's use of Steam voice
workshop_build_item : workshop_build_item <build config filename> : build a workshop item
workshop_create_legacy_item : workshop_create_legacy_item <appid> <workshop file> : build a legacy workshop item
workshop_download_item : workshop_download_item <appid> <PublishedFileId> : download an item using the workshop system
workshop_status : workshop_status <appId>

However, only a few are incorporated in SteamPS.

Context "Private or Public? What are the use cases? Parameters? Options?"

Consider implementing some of them e.g. workshop_download_item that can be useful when keep a game server up to date.

Suggested parameters to implement in some decent way:

  • workshop_download_item

Context "Additional Information"

https://github.com/dgibbs64/SteamCMD-Commands-List/blob/master/steamcmd_commands.txt

Get-SteamPlayerBan should return a PSObject

Describe "Functionality"

The cmdlet should return a PSObject with the response from the API.

Context "Private or Public? What are the use cases? Parameters? Options?"

  • Remove the parameter OutputFormat

Context "Additional Information"

Rework so Get-SteamServerInfo uses Server queries

Describe "Functionality"

Change so cmdlet Get-SteamServerInfo retrieves data from a Steam based server using Server queries instead of Rust Server Info.

Context "Private or Public? What are the use cases? Parameters? Options?"

Current parameters are:

Get-SteamServerInfo [-ServerID] <String> [<CommonParameters>]

Parameters should after rework contain IP and Port.

Context "Additional Information"

Module still versioned as 3.2.1

3.2.2 is in the releases section as Stable, but in SteamPS.psd1 (and possibly other places) the module is still versioned as 3.2.1.

It also didn't get updated on PowershellGallery.

Log file not created

Describe "Module Bug or Issue"

Could not find a part of the path 'C:\DedicatedServers\Logs\GB-PG12\GB-PG12_07-08-2020.log'.
Get-SteamServerInfo : System.Exception: Could not reach server 185.15.73.207:27016.
At C:\Program Files\WindowsPowerShell\Modules\SteamPS\3.1.1\Public\Update-SteamServer.ps1:125 char:29
+ ... $ServerStatus = Get-SteamServerInfo -IPAddress $IPAddress -Port $Port
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ConnectionError: (:) [Get-SteamServerInfo], Exception
    + FullyQualifiedErrorId : ServerNotFound,Get-SteamServerInfo

Write-Log : Cannot bind argument to parameter 'Message' because it is an empty string.
At C:\Program Files\WindowsPowerShell\Modules\SteamPS\3.1.1\Public\Update-SteamServer.ps1:126 char:32
+             Write-Log -Message $ServerStatus | Select-Object -Propert ...
+                                ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Write-Log], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Write-Log

Context "The Problem"

The log file is not created because the sub directory in the Logs folder is not created.

Context "Expected Behavior"

Log file needs to be created.

Context "Additional Information"

Get-Module -Name SteamPS -ListAvailable |
    Select-Object -Property Name, Version

$PSVersionTable | Out-String

Pester Tests for Web API cmdlets

Describe "Functionality"

Add Pester tests for

  • Get-SteamFriendList #75
  • Get-SteamNews #77
  • Get-SteamPlayerBan #78
  • Get-SteamPlayerSummary #80
  • Resolve-VanityURL #71

Context "Private or Public? What are the use cases? Parameters? Options?"

Context "Additional Information"

Change log format to json

Describe "Functionality"

Currently, logging is done to csv file. This should be changed to json.

Context "Private or Public? What are the use cases? Parameters? Options?"

Context "Additional Information"

Get-SteamFriendList should return a PSObject

Describe "Functionality"

The cmdlet should return a PSObject with the response from the API.

Context "Private or Public? What are the use cases? Parameters? Options?"

  • Remove the parameter OutputFormat

Context "Additional Information"

Test-SteamAPIKey

Describe "Functionality"

Cmdlet that returns a boolean depending if the API key has been set.

Context "Private or Public? What are the use cases? Parameters? Options?"

Will probably be a private cmdlet that is used in e.g. Resolve-VanityURL to test if there is an API key before attempting to call the Steam API.

Context "Additional Information"

Get-SteamPlayerSummary should return a PSObject

Describe "Functionality"

The cmdlet should return a PSObject with the response from the API.

Context "Private or Public? What are the use cases? Parameters? Options?"

  • Remove the parameter OutputFormat

Context "Additional Information"

Please use force_install_dir before logon!

Describe "Module Bug or Issue"

When updating / installing a game using Update-SteamApp, SteamCMD shows the following warning:

Please use force_install_dir before logon!

Context "The Problem"

The order of the parameters when calling SteamCMD could be switched.

Context "Expected Behavior"

The warning from SteamCMD should not occur.

Context "Additional Information"

image

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.1.20348.558                                                                           
PSEdition                      Desktop                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.20348.558                                                                          
CLRVersion                     4.0.30319.42000                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1                                                                                 

Move external help inside SteamPS / module folder

Describe "Module Bug or Issue"

Move external help inside SteamPS / module folder

Context "The Problem"

Context "Expected Behavior"

Context "Additional Information"

Get-Module -Name SteamPS -ListAvailable |
    Select-Object -Property Name, Version

$PSVersionTable | Out-String

Remove OutputFormat parameter from Resolve-VanityURL

Describe "Module Bug or Issue"

Resolve-VanityURL is returning a PSObject. However, it is still possible to specify the OutputFormat, but when used to get the output in xml or vdf it breaks.

Context "The Problem"

  • The OutputFormat parameter needs to be removed aligning the functionality of all cmdlets that are based on the Steam Web API.

Context "Expected Behavior"

Context "Additional Information"

Get-Module -Name SteamPS -ListAvailable |
    Select-Object -Property Name, Version

$PSVersionTable | Out-String

Update-SteamServer - backup config

Describe "Functionality"

Add new parameter -BackupConfig

Input should be a path that contains the config, or perhaps an array of paths that points to config files that needs to be backed up before updating the server.

Context "Private or Public? What are the use cases? Parameters? Options?"

Context "Additional Information"

Get-SteamAppInfo

Describe "Functionality"

Retrieves the app_info for the provided application id using steamcmd.exe.

"+login anonymous +app_info_update 1 +app_info_print $AppID +quit"
function Get-SteamAppInfo {
    [CmdletBinding()]
    param (
        [Parameter(Position = 0,
            Mandatory = $true,
            ValueFromPipelineByPropertyName = $true,
            ParameterSetName = 'AppID'
        )]
        [int]$AppID
    )

    begin {
    }

    process {
        $AppInfo = "'$((Get-SteamPath).Executable)' '+login anonymous +app_info_update 1 +app_info_print $AppID +quit' > $env:TEMP"
        Invoke-Expression -Command $AppInfo

    }
}

The output is returned in VDF which will need to be converted to PS Objects.

Context "Private or Public? What are the use cases? Parameters? Options?"

Takes the parameter -AppID.

Already implemented here but would be nice to have it as a cmdlet: https://github.com/BartJolling/ps-steam-cmd/blob/master/SteamCmd.psm1

Context "Additional Information"

UserName / vanityURL switch

Describe "Functionality"

Consider add a UserName / vanityURL switch to all Steam Web API cmdlets.

Context "Private or Public? What are the use cases? Parameters? Options?"

Context "Additional Information"

Get-SteamServerInfo Cmdlet fails for linux based "The Isle" servers

Describe "Module Bug or Issue"

Get-SteamServerInfo Cmdlet works for windows based game servers (The Isle) but not for linux based.

Context "The Problem"

Lately the The Isle game developers have introduced new servers which are now based on linux (that is the only change that I know of). For these servers the query fails:

PS c:\> Get-SteamServerInfo -IPAddress '34.244.178.139' -Port 27015
Exception calling "ReadByte" with "0" argument(s): "Unable to read beyond the end of the stream."
At C:\Program Files\WindowsPowerShell\Modules\SteamPS\3.2.1\Private\Server\Get-PacketString.ps1:31 char:13
+             $byte = $Stream.ReadByte()
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : EndOfStreamException

This error loops endlessly and you have to ctrl+c to stop the Cmdlet.

Context "Expected Behavior"

It is possible to query this server (it is based on windows):

PS c:\> Get-SteamServerInfo -IPAddress '3.250.191.172' -Port 27015

Protocol      : 17
ServerName    : UP4 - Mechanic Test - EU 1
Map           : Isla_Spiro
InstallDir    : theisle
GameName      : Evrima 0.8.29.04
AppID         : 0
Players       : 75
MaxPlayers    : 75
Bots          : 0
ServerType    : Dedicated
Environment   : Windows
Visibility    : Public
VAC           : Secured
Version       : 0.8.29.04
ExtraDataFlag : 177
IPAddress     : 3.250.191.172
Port          : 27015

Context "Additional Information"

PS c:\> Get-Module -Name SteamPS -ListAvailable | Select-Object -Property Name, Version

Name    Version
----    -------
SteamPS 3.2.1


PS c:\> $PSVersionTable | Out-String

Name                           Value
----                           -----
PSVersion                      5.1.19041.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.