GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - PoshCode/Metadata: Serialization for the PowerShell metadata format

BranchesTags
Open more actions menu

Latest commit

 

History

209 Commits
209 Commits

Folders and files

NameName
Last commit message
Last commit date
.config
.config
 
 
.github/workflows
.github/workflows
 
 
.vscode
.vscode
 
 
Benchmark
Benchmark
 
 
Source
Source
 
 
Specs
Specs
 
 
.gitignore
.gitignore
 
 
Build.ps1
Build.ps1
 
 
GitVersion.yml
GitVersion.yml
 
 
LICENSE
LICENSE
 
 
PSScriptAnalyzerSettings.psd1
PSScriptAnalyzerSettings.psd1
 
 
README.md
README.md
 
 
RequiredModules.psd1
RequiredModules.psd1
 
 
Test.ps1
Test.ps1
 
 
build.psd1
build.psd1
 
 

Repository files navigation

Build on push

The Metadata Module

Long the core of my Configuration module, the Metadata module is now shipping on it's own.

Metadata commands for working with PowerShell's metadata manifest content (.psd1 files):

  • Manipulating metadata files
  • Extensible serialization of types
  • Built in support for DateTime, Version, Guid, SecureString, ScriptBlocks and more
  • Lets you store almost anything in readable metadata (.psd1) files
  • Serializing (Export) to metadata (.psd1) files
  • Deserializing (Import) from metadata (.psd1) files

It supports WindowsPowerShell, as well as PowerShell Core on Windows, Linux and OS X.

Installation

Install-Module Metadata

Usage: Serialization

The main serialization commands (with the Metadata noun) are: ConvertFrom, ConvertTo, Import and Export. By default, the serializer can handle a variety of custom PSObjects, hashtables, and arrays recursively, and has specific handling for booleans, strings and numbers, as well as Versions, GUIDs, and DateTime, DateTimeOffset, and even ScriptBlocks and PSCredential objects.

Important note: PSCredentials are stored using ConvertTo-SecureString, and currently only work on Windows. They should be stored in the user scope, since they're serialized per-user, per-machine, using the Windows Data Protection API.

In other words, it handles everything you're likely to need in a configuration file. However, it also has support for adding additional type serializers via the Add-MetadataConverter command. If you want to store anything that doesn't work, please raise an issue 😉.

In addition, there are Get-Metadata and Update-Metadata commands that read individual values from metadata files.

Finally, there is a Update-Object command that can update an object or hashtable with values from a second object or hashtable.

About

Serialization for the PowerShell metadata format

Resources

Readme
MIT license
Activity
Custom properties

Stars

20 stars

Watchers

3 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.