Skip to content

Commit

Permalink
Refactor: Change -ModeEasy to a [switch] type
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed May 24, 2021
1 parent 7d3ec87 commit 7185350
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,27 @@ If prompted to trust the repository, hit `Y` and `enter`.
```powershell
Import-Module Position-ExplorerWindow
# Build the params
# Simply use -ModeEasy with a list of -Paths
Position-ExplorerWindow -ModeEasy -Paths 'C:/path/to/folder1', 'C:/path/to/folder2', 'C:/path/to/folder3', 'C:/path/to/folder4'
```

## Usage (advanced)

```powershell
Import-Module Position-ExplorerWindow
# Configure to your liking
$params = @{
'ModeEasy' = $ModeEasy
'Paths' = $Paths
'DestinationScreenWidth' = $DestinationScreenWidth
'DestinationScreenHeight' = $DestinationScreenHeight
'DestinationMonitor' = $DestinationMonitor
'Rows' = $Rows
'Cols' = $Cols
'OffsetLeft' = $OffsetLeft
'OffsetTop' = $OffsetTop
'Flow' = $Flow
'DebugLevel' = $DebugLevel
'Paths' = 'C:/path/to/folder1', 'C:/path/to/folder2', 'C:/path/to/folder3', 'C:/path/to/folder4', 'D:/path/to/folder1', 'D:/path/to/folder2', 'D:/path/to/folder3', 'D:/path/to/folder4'
'DestinationScreenWidth' = 1920
'DestinationScreenHeight' = 1080
'DestinationMonitor' = 'M'
'Rows' = 4
'Cols' = 2
'OffsetLeft' = 0
'OffsetTop' = 0
'Flow' = 'Y'
'DebugLevel' = 0
}
# Call with params splatting
Position-ExplorerWindow @params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ function Position-ExplorerWindow {
.PARAMETER ModeEasy
# Simple Mode. In this mode, most defaults are used.
# If you hate configurations, simply set this to 1 and you're done.
# Default: 0
# If you hate configurations, simply use this with -Paths
.PARAMETER DestinationScreenWidth
# Resolution of the Destination Screen (think of this as block of pixels, and not necesarily a Monitor's resolution) where the Explorer windows will reside.
Expand Down Expand Up @@ -140,7 +139,7 @@ function Position-ExplorerWindow {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$False,Position=0)]
[int]$ModeEasy = 0
[switch]$ModeEasy
,
[Parameter(Mandatory=$True,Position=1)]
[String[]]$Paths
Expand Down

0 comments on commit 7185350

Please sign in to comment.