Skip to content

Commit 8f89bca

Browse files
v2.47.0
1 parent 3b026f4 commit 8f89bca

12 files changed

+253
-172
lines changed

PSScriptTools.psd1

-4 Bytes
Binary file not shown.

PSScriptTools.psm1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ if ($psEditor) {
121121
if ($host.name -match 'Code') {
122122

123123
$context = $psEditor.GetEditorContext()
124-
$thispath = $context.CurrentFile.Path
125-
$target = Split-Path -Path $thispath
126-
Write-Verbose "Using $thispath"
124+
$ThisPath = $context.CurrentFile.Path
125+
$target = Split-Path -Path $ThisPath
126+
Write-Verbose "Using $ThisPath"
127127
Write-Verbose "Changing to $target"
128128
Set-Location -Path $target
129129

@@ -134,7 +134,7 @@ if ($psEditor) {
134134
}
135135
}
136136
} #VSCode
137-
elseif ($psIse) {
137+
elseif ($psISE) {
138138
Write-Verbose 'Defining ISE additions'
139139

140140
if ($psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.DisplayName -NotContains 'ToDo') {
@@ -144,9 +144,9 @@ elseif ($psIse) {
144144
$title = 'To Do'
145145
$item = Invoke-InputBox -Title $title -Prompt $prompt
146146
$todo = "# [$(Get-Date)] TODO: $item"
147-
$psise.CurrentFile.Editor.InsertText($todo)
147+
$psISE.CurrentFile.Editor.InsertText($todo)
148148
#jump cursor to the end
149-
$psise.CurrentFile.editor.SetCaretPosition($psise.CurrentFile.Editor.CaretLine, $psise.CurrentFile.Editor.CaretColumn)
149+
$psISE.CurrentFile.editor.SetCaretPosition($psISE.CurrentFile.Editor.CaretLine, $psISE.CurrentFile.Editor.CaretColumn)
150150
}
151151
#add the action to the Add-Ons menu
152152
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('ToDo', $Action, 'Ctrl+Alt+2' ) | Out-Null

PSScriptToolsManual.pdf

3.22 MB
Binary file not shown.

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,12 @@ The output will only show native members, including static methods, but not thos
17031703

17041704
![static members](images/typemember-static.png)
17051705

1706+
The command will highlight properties that are enumerations.
1707+
1708+
![enum properties](images/typemember-enum.png)
1709+
1710+
The hightlighting only works in the console and VSCode.
1711+
17061712
The output includes a property set type extension.
17071713

17081714
```dos
@@ -1718,6 +1724,28 @@ AddMinutes System.DateTime False $obj.AddMinutes([Double]value)
17181724
...
17191725
```
17201726

1727+
Or you can use the custom view.
1728+
1729+
```dos
1730+
PS C:\> Get-TypeMember datetime -MemberType method | Format-Table -View Syntax
1731+
1732+
1733+
Type: System.DateTime
1734+
1735+
Name ReturnType Syntax
1736+
---- ---------- ------
1737+
Add DateTime $obj.Add([TimeSpan]value)
1738+
AddDays DateTime $obj.AddDays([Double]value)
1739+
AddHours DateTime $obj.AddHours([Double]value)
1740+
AddMilliseconds DateTime $obj.AddMilliseconds([Double]value)
1741+
AddMinutes DateTime $obj.AddMinutes([Double]value)
1742+
AddMonths DateTime $obj.AddMonths([Int32]months)
1743+
AddSeconds DateTime $obj.AddSeconds([Double]value)
1744+
AddTicks DateTime $obj.AddTicks([Int64]value)
1745+
AddYears DateTime $obj.AddYears([Int32]value)
1746+
...
1747+
```
1748+
17211749
### [New-PSDynamicParameter](docs/New-PSDynamicParameter.md)
17221750

17231751
This command will create the code for a dynamic parameter that you can insert into your PowerShell script file. You need to specify a parameter name and a condition. The condition value is code that would run inside an If statement. Use a value like $True if you want to add it later in your scripting editor.

changelog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
This file contains the most recent change history for the PSScriptTools module.
44

5+
## v2.47.0
6+
7+
### Changed
8+
9+
- Added missing online help links.
10+
- Updated module description in the manifest.
11+
- Added `EnableLN` parameter alias to `Get-FolderSizeInfo`.
12+
- Help updates.
13+
- Update `Get-TypeMember` to identify properties that are enumerations.
14+
- Updated format file for `Get-TypeMember` to highlight enum properties.
15+
- Updated `README.md`.
16+
517
## v2.46.0
618

719
### Changed

docs/Get-FolderSizeInfo.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ Note that this command has been optimized for performance, but if you have a lot
3030
```powershell
3131
PS C:\> Get-FolderSizeInfo -Path d:\temp
3232
33-
Computername Path TotalFiles TotalSize
34-
------------ ---- ---------- ---------
35-
BOVINE320 D:\temp 48 121824451
33+
Computername Path TotalFiles TotalSize
34+
------------ ---- ---------- ---------
35+
BOVINE320 D:\temp 48 121824451
3636
```
3737

3838
### Example 2
3939

4040
```powershell
4141
PS C:\> Get-FolderSizeInfo -Path d:\temp -hidden
4242
43-
Computername Path TotalFiles TotalSize
44-
------------ ---- ---------- ---------
45-
BOVINE320 D:\temp 146 125655552
43+
Computername Path TotalFiles TotalSize
44+
------------ ---- ---------- ---------
45+
BOVINE320 D:\temp 146 125655552
4646
```
4747

4848
Include hidden files.
@@ -54,19 +54,19 @@ PS C:\> Get-ChildItem d:\ -Directory | Get-FolderSizeInfo |
5454
Where-Object TotalSize -gt 1MB | Sort-Object TotalSize -Descending |
5555
Format-Table -View mb
5656
57-
Computername Path TotalFiles TotalSizeMB
58-
------------ ---- ---------- -----------
59-
BOVINE320 D:\VMDisks 18 114873.7246
60-
BOVINE320 D:\ISO 17 42526.8204
61-
BOVINE320 D:\SQLServer2017Media 1 710.8545
62-
BOVINE320 D:\officeViewers 4 158.9155
63-
BOVINE320 D:\Temp 48 116.1809
64-
BOVINE320 D:\Sysinternals 153 59.6169
65-
BOVINE320 D:\blog 41 21.9948
66-
BOVINE320 D:\BackTemp 2 21.6734
67-
BOVINE320 D:\rip 3 11.1546
68-
BOVINE320 D:\logs 134 3.9517
69-
BOVINE320 D:\2016 5 1.5608
57+
Computername Path TotalFiles TotalSizeMB
58+
------------ ---- ---------- -----------
59+
BOVINE320 D:\VMDisks 18 114873.7246
60+
BOVINE320 D:\ISO 17 42526.8204
61+
BOVINE320 D:\SQLServer2017Media 1 710.8545
62+
BOVINE320 D:\officeViewers 4 158.9155
63+
BOVINE320 D:\Temp 48 116.1809
64+
BOVINE320 D:\Sysinternals 153 59.6169
65+
BOVINE320 D:\blog 41 21.9948
66+
BOVINE320 D:\BackTemp 2 21.6734
67+
BOVINE320 D:\rip 3 11.1546
68+
BOVINE320 D:\logs 134 3.9517
69+
BOVINE320 D:\2016 5 1.5608
7070
```
7171

7272
Get the top-level directories from D and pipe them to Get-FolderSizeInfo. Items with a total size of greater than 1MB are sorted on the total size and then formatted as a table using a built-in view called MB which formats the total size in MB. There are also views named KB,GB and TB to display formatted results accordingly.
@@ -131,7 +131,7 @@ Enable support for long file and folder names. Read https://learn.microsoft.com/
131131
```yaml
132132
Type: SwitchParameter
133133
Parameter Sets: (All)
134-
Aliases: lfn
134+
Aliases: lfn,EnableLN
135135

136136
Required: False
137137
Position: Named

docs/Get-TypeMember.md

Lines changed: 62 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: PSScriptTools-help.xml
33
Module Name: PSScriptTools
4-
online version:
4+
online version: https://bit.ly/3JVpGLB
55
schema: 2.0.0
66
---
77

@@ -45,59 +45,70 @@ The command in this module includes custom format and type extensions. See help
4545
```powershell
4646
PS C:\> Get-TypeMember DateTime
4747
48-
Type: System.DateTime
49-
50-
Name MemberType ResultType IsStatic
51-
---- ---------- ---------- --------
52-
MaxValue Field datetime True
53-
MinValue Field datetime True
54-
UnixEpoch Field datetime True
55-
Add Method DateTime False
56-
AddDays Method DateTime False
57-
AddHours Method DateTime False
58-
...
59-
Date Property DateTime
60-
Day Property Int32
61-
DayOfWeek Property DayOfWeek
62-
DayOfYear Property Int32
63-
Hour Property Int32
64-
...
48+
Type: System.DateTime
49+
50+
Name MemberType ResultType IsStatic IsEnum
51+
---- ---------- ---------- -------- ------
52+
MaxValue Field datetime True
53+
MinValue Field datetime True
54+
Add Method DateTime
55+
AddDays Method DateTime
56+
AddHours Method DateTime
57+
AddMilliseconds Method DateTime
58+
AddMinutes Method DateTime
59+
AddMonths Method DateTime
60+
AddSeconds Method DateTime
61+
...
62+
Date Property DateTime
63+
Day Property Int32
64+
DayOfWeek Property DayOfWeek True
65+
DayOfYear Property Int32
66+
Hour Property Int32
67+
Kind Property DateTimeKind True
68+
Millisecond Property Int32
69+
Minute Property Int32
70+
...
6571
```
6672

67-
Static items will be shown in green.
73+
Static items will be shown in green. Enum properties will be shown in orange.
6874

6975
### EXAMPLE 2
7076

7177
```powershell
7278
PS C:\> Get-TypeMember DateTime -StaticOnly
7379
74-
Type: System.DateTime
75-
76-
Name MemberType ResultType IsStatic
77-
---- ---------- ---------- --------
78-
MaxValue Field datetime True
79-
MinValue Field datetime True
80-
UnixEpoch Field datetime True
81-
Compare Method Int32 True
82-
DaysInMonth Method Int32 True
83-
...
80+
Type: System.DateTime
81+
82+
Name MemberType ResultType IsStatic IsEnum
83+
---- ---------- ---------- -------- ------
84+
MaxValue Field datetime True
85+
MinValue Field datetime True
86+
Compare Method Int32 True
87+
DaysInMonth Method Int32 True
88+
Equals Method Boolean True
89+
FromBinary Method DateTime True
90+
FromFileTime Method DateTime True
91+
...
8492
```
8593

8694
### EXAMPLE 3
8795

8896
```powershell
8997
PS C:\> Get-TypeMember system.io.fileinfo -MemberType Property
9098
91-
Type: System.IO.FileInfo
92-
93-
Name MemberType ResultType IsStatic
94-
---- ---------- ---------- --------
95-
Attributes Property FileAttributes
96-
CreationTime Property DateTime
97-
CreationTimeUtc Property DateTime
98-
Directory Property DirectoryInfo
99-
DirectoryName Property String
100-
...
99+
Type: System.IO.FileInfo
100+
101+
Name MemberType ResultType IsStatic IsEnum
102+
---- ---------- ---------- -------- ------
103+
Attributes Property FileAttributes True
104+
CreationTime Property DateTime
105+
CreationTimeUtc Property DateTime
106+
Directory Property DirectoryInfo
107+
DirectoryName Property String
108+
Exists Property Boolean
109+
Extension Property String
110+
FullName Property String
111+
...
101112
```
102113

103114
Get only properties for System.IO.FileInfo.
@@ -109,18 +120,18 @@ PS C:\> Get-TypeMember datetime -MemberName add* | Format-Table -view syntax
109120
110121
Type: System.DateTime
111122
112-
Name ReturnType Syntax
113-
---- ---------- ------
114-
Add DateTime $obj.Add(\[TimeSpan\]value)
115-
AddDays DateTime $obj.AddDays(\[Double\]value)
116-
AddHours DateTime $obj.AddHours(\[Double\]value)
117-
AddMicroseconds DateTime $obj.AddMicroseconds(\[Double\]value)
118-
AddMilliseconds DateTime $obj.AddMilliseconds(\[Double\]value)
119-
AddMinutes DateTime $obj.AddMinutes(\[Double\]value)
120-
AddMonths DateTime $obj.AddMonths(\[Int32\]months)
121-
AddSeconds DateTime $obj.AddSeconds(\[Double\]value)
122-
AddTicks DateTime $obj.AddTicks(\[Int64\]value)
123-
AddYears DateTime $obj.AddYears(\[Int32\]value)
123+
Name ReturnType Syntax
124+
---- ---------- ------
125+
Add DateTime $obj.Add(\[TimeSpan\]value)
126+
AddDays DateTime $obj.AddDays(\[Double\]value)
127+
AddHours DateTime $obj.AddHours(\[Double\]value)
128+
AddMicroseconds DateTime $obj.AddMicroseconds(\[Double\]value)
129+
AddMilliseconds DateTime $obj.AddMilliseconds(\[Double\]value)
130+
AddMinutes DateTime $obj.AddMinutes(\[Double\]value)
131+
AddMonths DateTime $obj.AddMonths(\[Int32\]months)
132+
AddSeconds DateTime $obj.AddSeconds(\[Double\]value)
133+
AddTicks DateTime $obj.AddTicks(\[Int64\]value)
134+
AddYears DateTime $obj.AddYears(\[Int32\]value)
124135
```
125136

126137
Use the custom table view to see method syntax.

0 commit comments

Comments
 (0)