A basic VDF (Valve Data File) converter for PowerShell. Contains functions which you can use in your own PowerShell scripts
to convert contents of VDF files to other formats. Outputs PSObject
.
The file vdf-converter.ps1 has a function:
-
ConvertTo-PSObject
- returns the contents of a VDF file as a PSObject
You can simply copy the function you need from vdf-converter.ps1 into your own script and use it.
Note
|
Other utilities in this repository may depend on each other. If you want to simply copy them to your script, keep in mind that you’ll need to resolve these dependencies. If you don’t want to resolve dependencies yourself, use Method 3 listed below. |
Copy the vdf-converter.ps1 file and attach it to your script with:
. (Join-Path $PSScriptRoot ./vdf-converter.ps1)
To use this whole suite and all of its features, copy the src directory in your PowerShell project, for
example, to vdf-converter-powershell
directory (relative to where your script is). You can then include whichever source
file you need with (example):
. (Join-Path $PSScriptRoot ./vdf-converter-powershell/config-files.ps1)
This repository contains other useful features. Here is the list of files and functions:
-
config-files.ps1 - utilities for various Steam configuration files.
-
Get-LibraryFoldersVdf
- find and return raw contents of Steam’slibraryfolders.vdf
file, or$null
if it’s not found. Pass this raw contents to a converter function to get a desired data structure.
-
-
registry.ps1 - utilities for Steam registry entries.
-
Find-SteamDirectory
- finds and returns your Steam installation directory, or returns$null
if not found.
-
Pester 5.6 is used for unit tests in this project. Please note that Windows is shipped with much older version of Pester. For installation instructions follow the official guide.
To run the whole test suite (all available tests) with code coverage, use the pester.ps1
script:
pwsh .\pester.ps1
Otherwise, you can run individual tests in terminal by following the instructions in Pester quick start guide.
-
All tests are located in the tests directory or its subdirectories.
-
All test files are following the naming convention
*.Tests.ps1
. -
Coverage report is available at
./coverage/coverage.xml
(when you run the full test suite, of course);
Mozilla Public License 2.0 (also available on Mozilla’s website at: MPL 2.0)