Skip to content

Latest commit

 

History

History
564 lines (480 loc) · 19.8 KB

README.md

File metadata and controls

564 lines (480 loc) · 19.8 KB

GenXdev


NAME

GenXdev.Windows

SYNOPSIS

A Windows PowerShell module that provides ui Windows manipulation helpers

GenXdev.Windows License

FEATURES

* ✅ Allow resizing/repositioning/closing of Windows
* ✅ Read/write access to Windows special folder locations

DEPENDENCIES

WinOS - Windows-10 GenXdev.Helpers

INSTALLATION

Install-Module "GenXdev.Windows"
Import-Module "GenXdev.Windows"

UPDATE

Update-Module





Cmdlet Index

GenXdev.Windows

Command                  aliases          Description
Get-Window Returns a window helper for the main window of the specified process
Set-KnownFolderPath Sets a known folder's path using SHSetKnownFolderPath.
Get-KnownFolderPath Gets a known folder's path using SHGetKnownFolderPath.
Get-DesktopScalingFactor Returns the scaling factor that is configured for a monitor
Set-TaskbarAlignment Sets the alignment for the Windows 11+ Taskbar
Get-PowershellMainWindow Returns a window helper object for the mainwindow of the process responsible for hosting the Powershell terminal
Get-PowershellMainWindowProcess Returns the process of the window responsible for hosting the Powershell terminal
Set-WindowPosition wp Positions a window in a configurable manner, using commandline switches
Set-WindowPositionForSecondary wps Positions a window like Set-WindowPosition -> wp but defaults to the configured secondairy monitor
Copy-SetWindowPositionParameters The dynamic parameter block of a proxy function. This block can be used to copy a proxy function target's parameters .
Start-ProcessWithPriority nice
Initialize-ScheduledTaskScripts Creates daily and hourly PowerShell scripts and their corresponding scheduled task that will runas current-user and it's PowerShell profile





Cmdlets

 


GenXdev.Windows

Get-Window

Get-Window

SYNOPSIS

Returns a window helper for the main window of the specified process

SYNTAX

Get-Window [-ProcessName] <String> [<CommonParameters>]

DESCRIPTION

Returns a window helper for the main window of the specified process

PARAMETERS

-ProcessName <String>
    The process to get the window helper for
    Required?                    true
    Position?                    1
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Set-KnownFolderPath

Set-KnownFolderPath

SYNOPSIS

Sets a known folder's path using SHSetKnownFolderPath.

SYNTAX

Set-KnownFolderPath [-KnownFolder] <String> [-Path] <String> [<CommonParameters>]

DESCRIPTION

Sets a known folder's path using SHSetKnownFolderPath.

PARAMETERS

-KnownFolder <String>
    The known folder whose path to set.
    Required?                    true
    Position?                    1
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
-Path <String>
    The path.
    Required?                    true
    Position?                    2
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Get-KnownFolderPath

Get-KnownFolderPath

SYNOPSIS

Gets a known folder's path using SHGetKnownFolderPath.

SYNTAX

Get-KnownFolderPath [-KnownFolder] <String> [<CommonParameters>]

DESCRIPTION

Gets a known folder's path using SHGetKnownFolderPath.

PARAMETERS

-KnownFolder <String>
    The known folder whose path to get.
    Required?                    true
    Position?                    1
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Get-DesktopScalingFactor

Get-DesktopScalingFactor

SYNOPSIS

Returns the scaling factor that is configured for a monitor

SYNTAX

Get-DesktopScalingFactor [[-monitor] <Int32>] [<CommonParameters>]

DESCRIPTION

Returns the scaling factor that is configured for a monitor

PARAMETERS

-monitor <Int32>
    The monitor to return the scaling factor for, or if not supplied the primary monitor is 
    used
    Required?                    false
    Position?                    1
    Default value                0
    Accept pipeline input?       false
    Accept wildcard characters?  false
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Set-TaskbarAlignment

Set-TaskbarAlignment

SYNOPSIS

Sets the alignment for the Windows 11+ Taskbar

SYNTAX

Set-TaskbarAlignment [-Justify] <Object> [<CommonParameters>]

DESCRIPTION

Sets the alignment for the Windows 11+ Taskbar

PARAMETERS

-Justify <Object>
    The new alignment
    Required?                    true
    Position?                    1
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Get-PowershellMainWindow

Get-PowershellMainWindow

SYNOPSIS

Returns a window helper object for the mainwindow of the process responsible for hosting 
the Powershell terminal

SYNTAX

Get-PowershellMainWindow [<CommonParameters>]

DESCRIPTION

Returns a window helper object for the mainwindow of the process responsible for hosting 
the Powershell terminal

PARAMETERS

<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Get-PowershellMainWindowProcess

Get-PowershellMainWindowProcess

SYNOPSIS

Returns the process of the window responsible for hosting the Powershell terminal

SYNTAX

Get-PowershellMainWindowProcess [<CommonParameters>]

DESCRIPTION

Returns the process of the window responsible for hosting the Powershell terminal

PARAMETERS

<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Set-WindowPosition

Set-WindowPosition                   --> wp

SYNOPSIS

Positions a window

SYNTAX

Set-WindowPosition [[-Process] <Process[]>] [-Monitor <Int32>] [-NoBorders] [-Width 
<Int32>] [-Height <Int32>] [-X <Int32>] [-Y <Int32>] [-Left] [-Right] [-Top] [-Bottom] 
[-Centered] [-RestoreFocus] [-PassThrough] [<CommonParameters>]

DESCRIPTION

Positions a window in a configurable manner, using commandline switches

PARAMETERS

-Process <Process[]>
    The process of the window to position
    Required?                    false
    Position?                    1
    Default value                
    Accept pipeline input?       true (ByValue, ByPropertyName)
    Accept wildcard characters?  false
-Monitor <Int32>
    The monitor to use, 0 = default, 1 = secondary, -1 is discard
    Required?                    false
    Position?                    named
    Default value                -1
    Accept pipeline input?       false
    Accept wildcard characters?  false
-NoBorders [<SwitchParameter>]
    Open in NoBorders mode --> -nb
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
-Width <Int32>
    The initial width of the window
    Required?                    false
    Position?                    named
    Default value                -1
    Accept pipeline input?       false
    Accept wildcard characters?  false
-Height <Int32>
    The initial height of the window
    Required?                    false
    Position?                    named
    Default value                -1
    Accept pipeline input?       false
    Accept wildcard characters?  false
-X <Int32>
    The initial X position of the window
    Required?                    false
    Position?                    named
    Default value                -1
    Accept pipeline input?       false
    Accept wildcard characters?  false
-Y <Int32>
    The initial Y position of the window
    Required?                    false
    Position?                    named
    Default value                -1
    Accept pipeline input?       false
    Accept wildcard characters?  false
-Left [<SwitchParameter>]
    Place window on the left side of the screen
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
-Right [<SwitchParameter>]
    Place window on the right side of the screen
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
-Top [<SwitchParameter>]
    Place window on the top side of the screen
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
-Bottom [<SwitchParameter>]
    Place window on the bottom side of the screen
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
-Centered [<SwitchParameter>]
    Place window in the center of the screen
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
-RestoreFocus [<SwitchParameter>]
    Restore PowerShell window focus --> -bg
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
-PassThrough [<SwitchParameter>]
    Returns a [System.Diagnostics.Process] object of the browserprocess
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Set-WindowPositionForSecondary

Set-WindowPositionForSecondary       --> wps

SYNOPSIS

Positions a window and positions it by default on the secondairy monitor

SYNTAX

Set-WindowPositionForSecondary [[-Monitor] <Int32>] [<CommonParameters>]

DESCRIPTION

Positions a window like Set-WindowPosition -> wp but defaults to the configured secondairy 
monitor

PARAMETERS

-Monitor <Int32>
    The monitor to use, 0 = default, 1 = secondary, -1 is discard
    Required?                    false
    Position?                    1
    Default value                -2
    Accept pipeline input?       false
    Accept wildcard characters?  false
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Copy-SetWindowPositionParameters

Copy-SetWindowPositionParameters

SYNOPSIS

Proxy function dynamic parameter block for the Set-WindowPosition cmdlet

SYNTAX

Copy-SetWindowPositionParameters [[-ParametersToSkip] <String[]>] [<CommonParameters>]

DESCRIPTION

The dynamic parameter block of a proxy function. This block can be used to copy a proxy 
function target's parameters .

PARAMETERS

-ParametersToSkip <String[]>
    Required?                    false
    Position?                    1
    Default value                @()
    Accept pipeline input?       false
    Accept wildcard characters?  false
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Start-ProcessWithPriority

Start-ProcessWithPriority            --> nice

SYNTAX

Start-ProcessWithPriority [-FilePath] <string> [[-ArgumentList] <string[]>] [[-Priority] 
{Idle | BelowNormal | Low | Normal | AboveNormal | High | RealTime}] [-noWait] 
[<CommonParameters>]

PARAMETERS

-ArgumentList <string[]>
    Required?                    false
    Position?                    1
    Accept pipeline input?       false
    Parameter set name           (All)
    Aliases                      None
    Dynamic?                     false
    Accept wildcard characters?  false
-FilePath <string>
    Required?                    true
    Position?                    0
    Accept pipeline input?       false
    Parameter set name           (All)
    Aliases                      None
    Dynamic?                     false
    Accept wildcard characters?  false
-Priority <string>
    Required?                    false
    Position?                    2
    Accept pipeline input?       false
    Parameter set name           (All)
    Aliases                      None
    Dynamic?                     false
    Accept wildcard characters?  false
-noWait
    Required?                    false
    Position?                    Named
    Accept pipeline input?       false
    Parameter set name           (All)
    Aliases                      None
    Dynamic?                     false
    Accept wildcard characters?  false
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216). 





Initialize-ScheduledTaskScripts

Initialize-ScheduledTaskScripts

SYNOPSIS

Creates daily and hourly PowerShell scripts and their corresponding scheduled tasks

SYNTAX

Initialize-ScheduledTaskScripts [[-FilePath] <String>] [[-Prefix] <String>] 
[<CommonParameters>]

DESCRIPTION

Creates daily and hourly PowerShell scripts and their corresponding scheduled task that 
will run
as current-user and it's PowerShell profile

PARAMETERS

-FilePath <String>
    Optionally the path of the directory where the scripts will reside
    Defaults to [ProfileDir]\ScheduledTasks
    Required?                    false
    Position?                    1
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
-Prefix <String>
    Optionally a unique prefix for the Scheduled-Task names
    Defaults to 'PS'
    Required?                    false
    Position?                    2
    Default value                PS
    Accept pipeline input?       false
    Accept wildcard characters?  false
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters     (https://go.microsoft.com/fwlink/?LinkID=113216).