Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
dce44dc
fix internal variables
mdowst Jun 12, 2024
ea9c69b
refactor galore
mdowst Jan 29, 2026
e4b207f
Stop tracking bin folder
mdowst Jan 31, 2026
bed4839
add menu and auto run
mdowst Jan 31, 2026
8457a0c
ui refactor
mdowst Feb 1, 2026
6dfbfa6
Add script execution
mdowst Feb 2, 2026
b802a09
pester tests
mdowst Feb 3, 2026
f99d436
automate Pester tests
mdowst Feb 4, 2026
4ce42d8
clean up build
mdowst Feb 5, 2026
3f21712
add note migration
mdowst Feb 5, 2026
43d380b
update import and export
mdowst Feb 7, 2026
ac23c0f
update build validation
mdowst Feb 7, 2026
afbdc52
add github actions
mdowst Feb 7, 2026
94d3503
build updates
mdowst Feb 7, 2026
6ba2d12
action fixes
mdowst Feb 7, 2026
ad8e093
build fix
mdowst Feb 7, 2026
e00036b
build fix
mdowst Feb 7, 2026
498e4a9
build fix
mdowst Feb 7, 2026
688f624
build fix
mdowst Feb 7, 2026
5ebf381
update help
mdowst Feb 7, 2026
9d90a6a
add script file support
mdowst Feb 7, 2026
cfd3012
update tests
mdowst Feb 7, 2026
a7fd90e
update tests
mdowst Feb 7, 2026
67500b2
update tests
mdowst Feb 7, 2026
29cebf2
update tests
mdowst Feb 7, 2026
b8b9711
update tests
mdowst Feb 7, 2026
b50a050
update tests
mdowst Feb 7, 2026
1b909b3
update tests
mdowst Feb 8, 2026
f320154
update tests
mdowst Feb 8, 2026
8d7a407
update tests
mdowst Feb 8, 2026
11fe459
update tests
mdowst Feb 8, 2026
45d9101
update tests
mdowst Feb 8, 2026
bad79f2
update tests
mdowst Feb 9, 2026
7f5faf0
update tests
mdowst Feb 9, 2026
343d553
update tests
mdowst Feb 9, 2026
b1dd2f7
remove alias default
mdowst Feb 9, 2026
e627d79
update note setting
mdowst Feb 13, 2026
c586d8b
update console
mdowst Feb 15, 2026
d473715
console updates
mdowst Feb 15, 2026
4bc8bcf
search not working
mdowst Feb 15, 2026
5bdc346
more console updates
mdowst Feb 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: build module

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-module:
name: Run build and upload artifacts
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0

- name: Install Modules
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module ModuleBuilder,PSScriptAnalyzer,EZOut
Install-Module Pester -MinimumVersion 5.5.0

- name: Run build
shell: pwsh
run: |
$Version = git describe --tags --abbrev=0
Write-Host "Version : $Version"
.\tools\build.ps1 -Version $Version

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: psnotes-build
path: bin

- name: Build Tests
shell: pwsh
run: .\tools\tests-build.ps1

- name: Build Report
uses: dorny/test-reporter@v2
if: ${{ !cancelled() }}
with:
name: Build Tests
path: 'bin/*.TestResults.xml'
reporter: java-junit

test-module:
needs: build-module
name: Test Module
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: bin
pattern: psnotes-build
merge-multiple: true
- run: ls -R bin

- name: Install Modules
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Pester -MinimumVersion 5.5.0
Install-Module PSScriptAnalyzer

- name: Unit Tests
shell: pwsh
run: .\tools\tests.ps1

- name: Test Report
uses: dorny/test-reporter@v2
if: ${{ !cancelled() }}
with:
name: Pester Tests
path: 'bin/*.TestResults.xml'
reporter: java-junit
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Publish/APIKey.json
Publish/PSNotes/
*.code-workspace
*.code-workspace
bin/
Documentation/demos/*
.vscode/*
25 changes: 0 additions & 25 deletions Documentation/Commands.MD

This file was deleted.

241 changes: 165 additions & 76 deletions Documentation/ConvertTo-Splatting.MD
Original file line number Diff line number Diff line change
@@ -1,96 +1,185 @@
# ConvertTo-Splatting
---
external help file: PSNotes-help.xml
Module Name: PSNotes
online version:
schema: 2.0.0
---

<a name="ConvertTo-Splatting"></a>
## ConvertTo-Splatting
# ConvertTo-Splatting

![ConvertTo-Splatting01](media/ConvertTo-Splatting01.png)
## SYNOPSIS

### Synopsis
Use to convert an existing PowerShell command to splatting
### Description
Splatting is a much cleaner and safer way to shorten command lines without needing to use backtick.
This function excepts any command as a string or a scriptblock and will convert the existing parameters

## SYNTAX

### string

```
ConvertTo-Splatting [[-Command <String>]] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### scriptblock

```
ConvertTo-Splatting [[-ScriptBlock <ScriptBlock>]] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION

Splatting is a much cleaner and safer way to shorten command lines without needing to use backtick.
This function excepts any command as a string or a scriptblock and will convert the existing parameters
to a hashtable and output the fully splatted command for you.

### Syntax
```powershell
ConvertTo-Splatting [[-Command] <string>] [<CommonParameters>]

ConvertTo-Splatting [[-ScriptBlock] <scriptblock>] [<CommonParameters>]
## EXAMPLES

### Example 1: EXAMPLE 1

```
### Parameters
#### Command &lt;String&gt;
The command string you want to convert to using splatting

Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
#### ScriptBlock &lt;ScriptBlock&gt;
The command scriptblock you want to convert to using splatting

Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
### Examples
#### Example 1: Converts the string splatme to splatting
```powershell
$splatme = @'
Set-AzVMExtension -ExtensionName "MicrosoftMonitoringAgent" -ResourceGroupName "rg-xxxx" -VMName "vm-xxxx" -Publisher "Microsoft.EnterpriseCloud.Monitoring" -ExtensionType "MicrosoftMonitoringAgent" -TypeHandlerVersion "1.0" -Settings @{"workspaceId" =
"xxxx" } -ProtectedSettings @{"workspaceKey" = "xxxx"} -Location "uksouth"
'@
$splatme = @'
Set-AzVMExtension -ExtensionName "MicrosoftMonitoringAgent" -ResourceGroupName "rg-xxxx" -VMName "vm-xxxx" -Publisher "Microsoft.EnterpriseCloud.Monitoring" -ExtensionType "MicrosoftMonitoringAgent" -TypeHandlerVersion "1.0" -Settings @{"workspaceId" = "xxxx" } -ProtectedSettings @{"workspaceKey" = "xxxx"} -Location "uksouth"
'@
ConvertTo-Splatting $splatme
```
###### Output
```
$SetAzVMExtensionParam = @{
ExtensionName = "MicrosoftMonitoringAgent"
ResourceGroupName = "rg-xxxx"
VMName = "vm-xxxx"
Publisher = "Microsoft.EnterpriseCloud.Monitoring"
ExtensionType = "MicrosoftMonitoringAgent"
TypeHandlerVersion = "1.0"
Settings = @{ "workspaceId" = "xxxx" }
ProtectedSettings = @{ "workspaceKey" = "xxxx" }
Location = "uksouth"
}

Converts the string splatme to splatting

--- Output ----
$SetAzVMExtensionParam = @{
ExtensionName = "MicrosoftMonitoringAgent"
ResourceGroupName = "rg-xxxx"
VMName = "vm-xxxx"
Publisher = "Microsoft.EnterpriseCloud.Monitoring"
ExtensionType = "MicrosoftMonitoringAgent"
TypeHandlerVersion = "1.0"
Settings = @{ "workspaceId" = "xxxx" }
ProtectedSettings = @{ "workspaceKey" = "xxxx" }
Location = "uksouth"
}
Set-AzVMExtension @SetAzVMExtensionParam





### Example 2: EXAMPLE 2

```
#### Example 2: Converts the scriptblock splatme to splatting
```powershell
$splatme = {
Copy-Item -Path "test.txt" -Destination "test2.txt" -WhatIf
}
$splatme = {
Copy-Item -Path "test.txt" -Destination "test2.txt" -WhatIf
}
ConvertTo-Splatting $splatme
```
###### Output
```
$CopyItemParam = @{
Path = "test.txt"
Destination = "test2.txt"
WhatIf = $true
}

Converts the scriptblock splatme to splatting

--- Output ----
$CopyItemParam = @{
Path = "test.txt"
Destination = "test2.txt"
WhatIf = $true
}
Copy-Item @CopyItemParam





### Example 3: EXAMPLE 3

```
#### Example 3: Removed backticks and converts the scriptblock splatme to splatting
```powershell
$splatme = {
Get-AzVM `
-ResourceGroupName "ResourceGroup11" `
-Name "VirtualMachine07" `
-Status
}
$splatme = {
Get-AzVM `
-ResourceGroupName "ResourceGroup11" `
-Name "VirtualMachine07" `
-Status
}
ConvertTo-Splatting $splatme
```
###### Output
```
$GetAzVMParam = @{
ResourceGroupName = "ResourceGroup11"
Name = "VirtualMachine07"
Status = $true
}

Removed backticks and converts the scriptblock splatme to splatting

--- Output ----
$GetAzVMParam = @{
ResourceGroupName = "ResourceGroup11"
Name = "VirtualMachine07"
Status = $true
}
Get-AzVM @GetAzVMParam






## PARAMETERS

### -Command

The command string you want to convert to using splatting

```yaml
Type: String
Parameter Sets: string
Aliases:
Accepted values:

Required: True (None) False (string)
Position: 0
Default value:
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
```

### -ProgressAction

{{ Fill ProgressAction Description }}

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Accepted values:

Required: True (None) False (All)
Position: Named
Default value:
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
```

### -ScriptBlock

The command scriptblock you want to convert to using splatting

```yaml
Type: ScriptBlock
Parameter Sets: scriptblock
Aliases:
Accepted values:

Required: True (None) False (scriptblock)
Position: 0
Default value:
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
```


### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## NOTES

about_Splatting - https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_splatting


## RELATED LINKS

Fill Related Links Here

Binary file removed Documentation/Copy-PSNote.MD
Binary file not shown.
Binary file modified Documentation/Export-PSNote.MD
Binary file not shown.
Loading
Loading