{% if page.tags.size > 0 %}
Tags:
{% if site.link-tags %}
{% for tag in page.tags %}
{{ tag }}
{% endfor %}
{% else %}
{{ page.tags | join: ", " }}
{% endif %}
function Get-AllADGoups { | |
<# | |
.SYNOPSIS | |
A brief description of the function or script. | |
.DESCRIPTION | |
Describe the function of the script using a single sentence or more. | |
.PARAMETER One | |
Description of the Parameter (what it does) |
function Invoke-MainFunc { | |
[CmdletBinding(SupportsShouldProcess = $true)] | |
param ( | |
[string]$message | |
) | |
Write-Verbose -Message ('Confirm is: {0}' -f $Confirm) -Verbose | |
Write-Verbose -Message ('Confirm is present: {0}' -f $PSBoundParameters.ContainsKey('Confirm')) -Verbose | |
Write-Verbose -Message ('PSBound is: {0}' -f $PSBoundParameters['Confirm']) -Verbose | |
Write-Verbose -Message ('Invoke.PSBound is present: {0}' -f $MyInvocation.BoundParameters.ContainsKey('Confirm')) -Verbose | |
Write-Verbose -Message ('Invoke.PSBound is: {0}' -f $MyInvocation.BoundParameters['Confirm']) -Verbose |
function Get-MyAwesomeCustomType { | |
[CmdletBinding()] | |
[OutputType('ModuleName.Context.Identifier')] | |
param() | |
$returnObj = [PSCustomObject]@{ | |
somePropertyKey = 'awesome value' | |
foo = 'bar' | |
} | |
$returnObj.PsObject.TypeNames.Insert(0, 'ModuleName.Context.Identifier') | |
Write-Output $returnObj |
{% if page.tags.size > 0 %}
<div class="about-container" > | |
<div class="about-container-header" data-toggle="tooltip" data-toggle="collapse" data-target="#aboutcontent" title="Display a summary about this page."> | |
<p class = "about-container-heading about-font-default"> | |
<i class="fa fa-paperclip about-font-out" aria-hidden="true"></i> | |
<span class="about-prompt"> | |
~> | |
</span> | |
<span class="about-font-cmd"> | |
Get-Help | |
</span> |
#region HEADER | |
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$RepoRoot = (Get-GitDirectory).replace('\.git', '') | |
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' | |
$sut = $sut -replace "\d{2}`_", '' | |
$suthome = (Get-ChildItem -Path $RepoRoot -Exclude ".\tests\" -Filter $sut -Recurse).FullName | |
# Skip try loading the source file if it doesn't exists. | |
If ($suthome.Length -gt 0) { | |
. $suthome | |
} |
hidden AddPublicMember() { | |
$Members = $this | Get-Member -Force -MemberType Property -Name '_*' | |
ForEach ($Member in $Members) { | |
$PublicPropertyName = $Member.Name -replace '_', '' | |
# Define getter part | |
$Getter = "return `$this.{0}" -f $Member.Name | |
$Getter = [ScriptBlock]::Create($Getter) | |
# Define setter part | |
$Setter = "Write-Warning 'This is a readonly property.'" | |
$Setter = [ScriptBlock]::Create($Setter) |
$Res.PSObject.TypeNames.Insert(0,'Sparc.whoami') | |
Write-Output $Res |
Import-Module ClassTest -Verbose -Force | |
using module ClassTest | |
$test = [ClassTest]::new() |
Class FooBar { | |
[string]$Prop1 | |
Foobar() { | |
$this | Add-Member -Name Prop1 -MemberType ScriptProperty -Value { | |
# This is the getter | |
return $this.Prop1 | |
} -SecondValue { | |
param($value) | |
# This is the setter |