Skip to content

Commit

Permalink
🐛 (!deploy) Fix issue with error being thrown when adding SteamCMD lo…
Browse files Browse the repository at this point in the history
…cation to PATH
  • Loading branch information
hjorslev authored Jul 12, 2020
1 parent 5d46852 commit e0f4e49
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](https://semver.org/).

## [3.1.1] - 12/07-2020

### Fixed

- Fix issue with error being thrown when adding SteamCMD location to PATH (#24).

## [3.1.0] - 07/07-2020

### Added
Expand Down
15 changes: 9 additions & 6 deletions SteamPS/Private/Add-EnvPath.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string] $Path,
[string]$Path,

[ValidateSet('Machine', 'User', 'Session')]
[string] $Container = 'Session'
[string]$Container = 'Session'
)

process {
Expand All @@ -24,18 +24,21 @@

$persistedPaths = [Environment]::GetEnvironmentVariable('Path', $containerType) -split ';'
if ($persistedPaths -notcontains $Path) {
$persistedPaths = $persistedPaths + $Path | Where-Object { $_ }
$persistedPaths = $persistedPaths + $Path | Where-Object -FilterScript { $_ }
[Environment]::SetEnvironmentVariable('Path', $persistedPaths -join ';', $containerType)
Write-Verbose -Message "Adding $Path to environment path."
} else {
Write-Verbose -Message "$Path is already located in env:Path."
}
Write-Verbose -Message "Adding $Path to environment path."
}

$envPaths = $env:Path -split ';'
Write-Verbose -Message "Current environment paths: $envPaths"
if ($envPaths -notcontains $Path) {
$envPaths = $envPaths + $Path | Where-Object { $_ }
$envPaths = $envPaths + $Path | Where-Object -FilterScript { $_ }
$env:Path = $envPaths -join ';'
Write-Verbose -Message "Adding $Path to environment path."
} else {
Write-Verbose -Message "$Path is already located in env:Path."
}
} # Process
} # Cmdlet
2 changes: 1 addition & 1 deletion SteamPS/Public/Get-SteamServerInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
MaxPlayers = [int]$Stream.ReadByte()
Bots = $Stream.ReadByte()
ServerType = [ServerType]$Stream.ReadByte()
Environment = [Environment]$Stream.ReadByte()
Environment = [OSType]$Stream.ReadByte()
Visibility = [Visibility]$Stream.ReadByte()
VAC = [VAC]$Stream.ReadByte()
Version = Get-PacketString -Stream $Stream
Expand Down
6 changes: 2 additions & 4 deletions SteamPS/SteamPS.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @('Find-SteamAppID','Get-SteamServerInfo','Install-SteamCMD','Update-SteamApp','Update-SteamServer')
FunctionsToExport = @('Find-SteamAppID', 'Get-SteamServerInfo', 'Install-SteamCMD', 'Update-SteamApp', 'Update-SteamServer')

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
# CmdletsToExport = @()
Expand Down Expand Up @@ -128,6 +128,4 @@
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}


}
2 changes: 1 addition & 1 deletion SteamPS/SteamPS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ enum ServerType {
NonDedicated = 0x6C #l
SourceTV = 0x70 #p
}
enum Environment {
enum OSType {
Linux = 108 #l
Windows = 119 #w
Mac = 109 #m
Expand Down

0 comments on commit e0f4e49

Please sign in to comment.