PoshCode Archive  Artifact [7e1bcb9b5f]

Artifact 7e1bcb9b5f8515cc606f743554c4f6183db06dac2d85075da79dd4ab7ef427f1:

  • File Get-ObjectIdentifier.ps1 — part of check-in [03726de51d] at 2018-06-10 13:08:52 on branch trunk — Resolves OID value to a Friendly Name and vice versa. The cmdlet resolves both well-known OIDs (used in Internet PKI) and Active Directory forest specific registered OIDs. (user: unknown size: 1669)

# encoding: ascii
# api: powershell
# title: Get-ObjectIdentifier
# description: Resolves OID value to a Friendly Name and vice versa. The cmdlet resolves both well-known OIDs (used in Internet PKI) and Active Directory forest specific registered OIDs.
# version: 1.0
# type: function
# license: CC0
# function: Get-ObjectIdentifier
# x-poshcode-id: 2334
# x-archived: 2010-11-02T18:11:10
#
#
#####################################################################
# Get-ObjectIdentifier.ps1
# Version 1.0
#
# Resolves OID value to a Friendly Name and vice versa.
#
# Vadims Podans (c) 2010
# http://en-us.sysadmins.lv/
#####################################################################
#requires -Version 2.0

function Get-ObjectIdentifier {
<#
.Synopsis
	Resolves OID value to a Friendly Name and vice versa.
.Description
	Resolves OID value to a Friendly Name and vice versa. The cmdlet resolves both
	well-known OIDs (used in Internet PKI) and Active Directory forest specific
	registered OIDs.
.Parameter OIDString
	Specifies the OID value or Friendly name.
.Example
	Get-ObjectIdentifier "Server Authentication"
	
	Will resolve "Server Authentication" OID to an object identifier value (1.3.6.1.5.5.7.3.1).
.Example
	Get-ObjectIdentifier "1.3.6.1.5.5.7.3.9"
	
	Will resolve "1.3.6.1.5.5.7.3.9" value to a friendly name (OCSP Signing).
.Outputs
	System.Security.Cryptography.Oid
#>
[CmdletBinding()]
[OutputType('System.Security.Cryptography.Oid')]
	param (
		[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
		[String[]]$OIDString
	)
	$OIDString | %{New-Object Security.Cryptography.Oid $OIDString}
}