Skip to content

Commit 11d6c4a

Browse files
v2.20.0
1 parent c996c1f commit 11d6c4a

15 files changed

+1381
-321
lines changed

PSScriptTools.psd1

316 Bytes
Binary file not shown.

README.md

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,34 @@ Please post any questions, problems or feedback in [Issues](https://github.com/j
2828

2929
## General Tools
3030

31+
### [Get-ModuleCommand](docs/Get-ModuleCommand.md)
32+
33+
This is an alternative to `Get-Command` to make it easier to see at a glance what commands are contained within a module and what they can do. By default, `Get-ModuleCommand` looks for loaded modules.
34+
Use `-ListAvailable` to see commands in module not currently loaded.
35+
Note that if the help file is malformed or missing, you might get oddly formatted results.
36+
37+
```powersehell
38+
PS C:\> Get-ModuleCommand PSCalendar
39+
40+
41+
Verb: Get
42+
43+
Name Alias Type Synopsis
44+
---- ----- ---- --------
45+
Get-Calendar cal Function Displays a visual representation of a ...
46+
47+
48+
Verb: Show
49+
50+
Name Alias Type Synopsis
51+
---- ----- ---- --------
52+
Show-Calendar scal Function Display a colorized calendar month in ...
53+
Show-GuiCalendar gcal Function Display a WPF-based calendar
54+
```
55+
56+
Get module commands using the default formatted view.
57+
There is also a default view for `Format-List`.
58+
3159
### [Get-PSScriptTools](docs/Get-PSScriptTools.md)
3260

3361
You can use this command to get a summary list of functions in this module.
@@ -1079,6 +1107,36 @@ I have long term plans to have a user-configurable color map for different item
10791107

10801108
This command has an alias of `pstree`.
10811109

1110+
```powershell
1111+
PS C:\> pstree c:\work\alpha -files -properties LastWriteTime,Length
1112+
1113+
C:\work\Alpha\
1114+
+-- LastWriteTime = 02/28/2020 11:19:32
1115+
+--bravo
1116+
| +-- LastWriteTime = 02/28/2020 11:20:30
1117+
| +--delta
1118+
| | +-- LastWriteTime = 02/28/2020 11:17:35
1119+
| | +--FunctionDemo.ps1
1120+
| | | +-- Length = 888
1121+
| | | \-- LastWriteTime = 06/01/2009 15:50:47
1122+
| | +--function-form.ps1
1123+
| | | +-- Length = 1117
1124+
| | | \-- LastWriteTime = 04/17/2019 17:18:28
1125+
| | +--function-logstamp.ps1
1126+
| | | +-- Length = 598
1127+
| | | \-- LastWriteTime = 05/23/2007 11:39:55
1128+
| | +--FunctionNotes.ps1
1129+
| | | +-- Length = 617
1130+
| | | \-- LastWriteTime = 02/24/2016 08:59:03
1131+
| | \--Function-SwitchTest.ps1
1132+
| | +-- Length = 242
1133+
| | \-- LastWriteTime = 06/09/2008 15:55:44
1134+
| +--gamma
1135+
...
1136+
```
1137+
1138+
Show a tree listing with files including a few properties. This example is using parameter and command aliases.
1139+
10821140
## Format-Functions
10831141

10841142
A set of simple commands to make it easier to format values.
@@ -1133,6 +1191,39 @@ TotalMemGB FreeMemGB PctFree
11331191

11341192
## Scripting Tools
11351193

1194+
### [Remove-MergedBranch](docs/Remove-MergedBranch.md)
1195+
1196+
When using git you may create a number of branches.
1197+
Presumably you merge these branches into the main or master branch.
1198+
You can this command to remove all merged branches other than master and the current branch.
1199+
You must be in the root of your project to run this command.
1200+
1201+
```powershell
1202+
PS C:\MyProject> Remove-MergedBranch
1203+
1204+
Remove merged branch from MyProject?
1205+
2.1.1
1206+
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): n
1207+
1208+
Remove merged branch from MyProject?
1209+
dev1
1210+
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
1211+
Deleted branch dev1 (was 75f6ab8).
1212+
1213+
Remove merged branch from MyProject?
1214+
dev2
1215+
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
1216+
Deleted branch dev2 (was 75f6ab8).
1217+
1218+
Remove merged branch from MyProject?
1219+
patch-254
1220+
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): n
1221+
1222+
PS C:\MyProject>
1223+
```
1224+
1225+
By default you will be prompted to remove each branch.
1226+
11361227
### [Test-WithCulture](docs/Test-WithCulture.md)
11371228

11381229
When writing PowerShell commands, sometimes the culture you are running under becomes critical. For example, European countries use a different datetime format than North Americans which might present a problem with your script or command. Unless you have a separate computer running under the foreign culture, it is difficult to test. This command will allow you to test a scriptblock or even a file under a different culture, such as DE-DE for German.
@@ -1298,8 +1389,12 @@ This will display the service status color-coded.
12981389

12991390
![ServiceAnsi](images/serviceansi.png)
13001391

1392+
## Related Modules
1393+
1394+
If you find this module useful, you might also want to look at my tools for [creating and managing custom type extensions](https://github.com/jdhitsolutions/PSTypeExtensionTools), [managing scheduled jobs](https://github.com/jdhitsolutions/ScheduledJobTools) and [running remote commands outside of PowerShell Remoting](https://github.com/jdhitsolutions/PSRemoteOperations)
1395+
13011396
## Compatibility
13021397

13031398
Where possible these commands have been tested with PowerShell 7, but not every platform. If you encounter problems, have suggestions or other feedback, please post an issue. It is assumed you will __not__ be running this commands on any edition of PowerShell Core or any beta releases of PowerShell 7.
13041399

1305-
Last Updated *2020-02-28 17:24:23Z UTC*
1400+
Last Updated *2020-03-02 17:43:53Z UTC*

0 commit comments

Comments
 (0)