-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
882b935
commit 90a9c3e
Showing
4 changed files
with
99 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
builds/linux/psminimize | ||
builds/windows/psminimize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
# PowerShellMinimize | ||
IN PROGRESS | ||
# psminimize | ||
psminimize is a simple utility that tries to minimize a powershell script file. It only uses basic logic to perform the minimization but in general can reduce a ps1 file by half depending on the variable name length. As this is really just a fancy find and replace there are some edge cases to watch out for. | ||
|
||
## Limitations | ||
* Function parameter variables will be renamed. If you define the function/cmdlet within the script and rely on it's name when calling later you will need to manually fix the calling statement. | ||
|
||
## Usage | ||
`psminimize -s script.ps1 -o script.min.ps` | ||
|
||
# Steps? | ||
- [X] remove comments | ||
- [ ] shorten variable names | ||
- find all variables. | ||
- replace all with unique names | ||
- generate short names to replace unique | ||
- replace with new short names | ||
- [ ] shorten function names | ||
- [ ] remove returns | ||
- [ ] alias cmdlets | ||
|
||
|long|short|description|required| | ||
|----|----|----|----| | ||
|script-path|s|The path to the script file to minimize.|true| | ||
|output-path|o|The path to write the script two.|true| | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
env GOOS=linux GOARCH=amd64 go build -o ./builds/linux/psminimize | ||
env GOOS=windows GOARCH=amd64 go build -o ./builds/windows/psminimize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters