Skip to content

Commit

Permalink
Return nonzero exit code when module or preset file doesn't exist, re…
Browse files Browse the repository at this point in the history
  • Loading branch information
Disassembler0 committed Sep 5, 2019
1 parent d8f790e commit 30382f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Win10.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ $i = 0
While ($i -lt $args.Length) {
If ($args[$i].ToLower() -eq "-include") {
# Resolve full path to the included file
$include = Resolve-Path $args[++$i]
$include = Resolve-Path $args[++$i] -ErrorAction Stop
$PSCommandArgs += "-include `"$include`""
# Import the included file as a module
Import-Module -Name $include
Import-Module -Name $include -ErrorAction Stop
} ElseIf ($args[$i].ToLower() -eq "-preset") {
# Resolve full path to the preset file
$preset = Resolve-Path $args[++$i]
$preset = Resolve-Path $args[++$i] -ErrorAction Stop
$PSCommandArgs += "-preset `"$preset`""
# Load tweak names from the preset file
Get-Content $preset -ErrorAction Stop | ForEach-Object { AddOrRemoveTweak($_.Split("#")[0].Trim()) }
Expand Down

0 comments on commit 30382f9

Please sign in to comment.