You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PowerShell module contains a number of functionsyou might use to enhance your own functions and scripts. The [Samples](./samples) folder contains demonstration script files.
5
+
This module contains a collection of functions, variables and format files that you can use to enhance your PowerShell scripting work. Or get more done from a PowerShell prompt with less typing. Most of the commands are designed to work cross-platform.
You can also turn this into a text block using the `AsString` parameter. This is helpful when you want to include the output in some type of report.
327
+
328
+

329
+
327
330
### [Find-CimClass](docs/Find-CimClass.md)
328
331
329
332
This function is designed to search an entire CIM repository for a class name. Sometimes, you may have a guess about a class name but not know the full name or even the correct namespace. `Find-CimClass` will recursively search for a given classname. You can use wildcards and search remote computers.
@@ -392,6 +395,25 @@ You can also get detailed information.
392
395
393
396
Results will vary depending on whether you are running PowerShell on Windows nor non-Windows systems.
394
397
398
+
### [Get-PathVariable](docs/Get-PathVariable.md)
399
+
400
+
Over time, as you add and remove programs, your `%PATH%` might change. An application may add a location but not remove it when you uninstall the application. This command makes it easier to identify locations and whether they are still good.
401
+
402
+
```powershell
403
+
PS C:\> Get-PathVariable
404
+
405
+
Scope UserName Path Exists
406
+
----- -------- ---- ------
407
+
User Jeff C:\Program Files\kdiff3 True
408
+
User Jeff C:\Program Files (x86)\Bitvise SSH Client True
409
+
User Jeff C:\Program Files\OpenSSH True
410
+
User Jeff C:\Program Files\Intel\WiFi\bin\ True
411
+
User Jeff C:\Program Files\Common Files\Intel\WirelessCommon\ True
412
+
User Jeff C:\Users\Jeff\AppData\Local\Programs\Microsoft VS Code\bin True
413
+
User Jeff C:\Program Files (x86)\Vale\ True
414
+
...
415
+
```
416
+
395
417
## File Tools
396
418
397
419
### [Test-EmptyFolder](docs/Test-EmptyFolder.md)
@@ -1125,6 +1147,50 @@ C:\work\Alpha\
1125
1147
1126
1148
This example is using parameter and command aliases. You can display a tree listing with files including user specified properties. Use a value of * to show all properties.
1127
1149
1150
+
### [New-ANSIBar](docs/New-ANSIBar.md)
1151
+
1152
+
You can use this command to create colorful bars using ANSI escape sequences based on a 256 color scheme. The default behavior is to create a gradient bar that goes from first to last values in the range and then back down again. Or you can create a single gradient that runs from the beginning of the range to the end. You can use one of the default characters or specify a custom one.
A related command is `New-RedGreenGradient` which displays a bar going from red to green. This might be handy when you want to present a visual indicator.
A set of simple commands to make it easier to format values.
@@ -1385,7 +1451,7 @@ You will need to manually install the file.
1385
1451
1386
1452
## Other
1387
1453
1388
-
From time to time I will include additional items that you might find useful. One item that you get when you import this module is a custom format.ps1xml file for services. If you are running PowerShell 7, you can run `Get-Service` and pipe it to the table view.
1454
+
From time to time I will include additional items that you might find useful. One item that you get when you import this module is a custom format.ps1xml file for services. You can run `Get-Service` and pipe it to the table view.
1389
1455
1390
1456
```powershell
1391
1457
PS C:\> Get-Service | Format-Table -view ansi
@@ -1395,6 +1461,8 @@ This will display the service status color-coded.
1395
1461
1396
1462

1397
1463
1464
+
This will not work in the PowerShell ISE as it is not ANSI aware.
1465
+
1398
1466
### PSAnsiMap
1399
1467
1400
1468
I have done something similar for output from `Get-ChildItem`. The module includes json file that is exported as a global variable called `PSAnsiFileMap`.
@@ -1417,7 +1485,7 @@ ChildContainer
1417
1485
1418
1486
The map includes ANSI settings for different file types. You won't see the ANSI value in the output. The module will add a custom table view called `ansi` which you can use to display file results colorized in PowerShell 7.
1419
1487
1420
-

1488
+

1421
1489
1422
1490
The mapping file is user customizable. Copy the `psansifilemap.json` file from the module's root directory to $HOME. When you import this module, if the file is found, it will be imported and used as `psansifilemap`, otherwise the module's file will be used.
1423
1491
@@ -1475,6 +1543,26 @@ The file will look like this:
1475
1543
1476
1544
You can create or modify file groups. The Pattern value should be a regular expression pattern to match on the filename. Don't forget you will need to escape characters for the json format. The Ansi value will be an ANSI escape sequence. You can use `\u001b` for the \``e` character.
1477
1545
1546
+
### PSSpecialChar
1547
+
1548
+
A number of the commands in this module can use special characters. To make it easier, when you import the module it will create a global variable that is a hash table of common special characters. Because it is a hashtable you can add ones you also use.
1549
+
1550
+

1551
+
1552
+
The names are the same as used in CharMap.exe. Don't let the naming confuse you. It may say `BlackSquare` but the color will depend on how you use it.
This PowerShell module contains a number of functions you might use to enhance your own functions and scripts. The [Samples](./samples) folder contains demonstration script files. You can access the folder in PowerShell using the `$PSSamplePath`. The samples provide suggestions on how you might use some of the commands in this module. The scripts are offered AS-IS and are for demonstration purposes only.
1563
+
1564
+

1565
+
1478
1566
## Related Modules
1479
1567
1480
1568
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).
@@ -1483,4 +1571,4 @@ If you find this module useful, you might also want to look at my tools for [cre
1483
1571
1484
1572
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](https://github.com/jdhitsolutions/PSScriptTools/issues). It is assumed you will __not__ be running this commands on any edition of PowerShell Core or any beta releases of PowerShell 7.
Copy file name to clipboardExpand all lines: changelog.md
+33-1Lines changed: 33 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,43 @@
1
1
# Change Log for PSScriptTools
2
2
3
+
## v2.24.0
4
+
5
+
### Add
6
+
7
+
+ Added parameter alias of `tb` for `-TextBlock` in `Add-Border`.
8
+
+ Added parameter alias of `border` for `-Character` in `Add-Border`.
9
+
+ Added `New-ANSIBar` command.
10
+
+ Added `New-RedGreenGradient` command.
11
+
+ Added `Write-ANSIProgress` command with an alias of `wap`.
12
+
+ Defined a global variable called `$PSSpecialChar` which is a hash table select special characters you might want to use with `Add-Border` or `New-AnsiBar`.
13
+
+ Added a table view to `modulecommand.format.ps1xml` and made it the default.
14
+
+ Added a new table view called `verb` to `modulecommand.format.ps1xml`.
15
+
+ Added `Get-PathVariable` with its own custom format file. (Issue #74)
16
+
+ Added sample script `Get-Status.ps1`.
17
+
+ Added global variable `$PSSamplePath` to point to the sample script location
18
+
19
+
### Change
20
+
21
+
+ Modified `Add-Border` to adjust line length when ANSI escapes are part of the text. (Issue #79)
22
+
+ Modified `Get-PSWho` to trim when using `-AsString`.
23
+
+ Fixed bug in `New-PSFormatXML` what was writing an XML element to the pipeline when using `-Wrap`.
24
+
+ Updated `Get-ModuleCommand` output to include the module name.
25
+
+ Updated `serviceansi.format.ps1xml` and `filesystem-ansi.format.ps1xml` to use an escape sequence available to both Windows PowerShell and PowerShell 7.
26
+
+ Fixed wrong type name in `serviceansi.format.ps1xml`.
27
+
+ Help updates.
28
+
+ Updated sample scripts.
29
+
+ Updated `README.md`.
30
+
31
+
### Delete
32
+
33
+
+ Removed duplicate line of code in `New-PSFormatXML`.
34
+
3
35
## v2.23.0
4
36
5
37
+ Updated `New-PSFormatXML` to include an option to wrap tables. (Issue #78)
6
38
+ Updated `Add-Border` to include parameters to specify an ANSI sequence for the border and one for the text.
7
39
+ Revised `Add-Border` to better support inserting blank lines.
This will write a color version of the text and border. You would this type of ANSI syntax for Windows PowerShell. In PowerShell 7, you can use the same syntax or the much easier "`e[38;5;47m".
0 commit comments