Public/Start-NotepadPlusPlus.ps1

Function Start-NotepadPlusPlus {
    <#
    .Synopsis
        Start NotepadPlusPlus
    .Description
        Starts NotepadPlusPlus
    .Parameter File
        Open file
    .Example
        Start-NotepadPlusPlus
        Starts NotepadPlusPlus
    .Example
        Start-NotepadPlusPlus -File C:\somefile.txt
        Starts NotepadPlusPlus and opens somefile.txt
    .LINK
        about_functions_advanced
    .LINK
        about_CommonParameters
    #>

    [CmdletBinding()]
    Param(
        [String]$File
    )
    $notepadplusplus = "C:\Program Files (x86)\Notepad++\notepad++.exe"
    $FileExists = Test-Path $notepadplusplus
    If ($FileExists -eq "True") {
        If (!(Get-Process notepad++ -ErrorAction SilentlyContinue)) {
            Start-Process $notepadplusplus -ArgumentList $file
        } ElseIf (Get-Process notepad++ -ErrorAction SilentlyContinue) {
            Write-Warning "Notepad++ is allready running..."
        }
    }
}