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 command will search a given directory and produce a report of all files based on their file extension. This command is only available in PowerShell 7. The extension with the largest total size will be highlighted in color.
598
+
599
+

600
+
595
601
### [Test-EmptyFolder](docs/Test-EmptyFolder.md)
596
602
597
603
This command will test if a given folder path is empty of all files anywhere in the path. This includes hidden files. The command will return True even if there are empty sub-folders. The default output is True or False but you can use -Passthru to get more information.
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.
1653
+
1654
+
```powershell
1655
+
PS C:\> New-PSDynamicParameter -Condition "$PSEdition -eq 'Core'" -ParameterName ANSI -Alias color -Comment "Create a parameter to use ANSI if running PowerShell 7" -ParameterType switch
1656
+
1657
+
DynamicParam {
1658
+
# Create a parameter to use ANSI if running PowerShell 7
This creates dynamic parameter code that you can use in a PowerShell function. Normally you would save this output to a file or copy to the clipboard so that you can paste it into scripting editor.
1683
+
1684
+
You can also use a WPF-based front-end command, [New-PSDynamicParameterForm](docs/New-PSDynamicParameterForm.md). You can enter the values in the form. Required values are indicated by an asterisk.
If you import the module in VS Code using the integrated PowerShell terminal, it will a new command. In the command palette, use `PowerShell: Show Additional Commands from PowerShell Modules".
For the most part, objects you work with in PowerShell are guaranteed to be unique. But you might import data where there is the possibility of duplicate items. Consider this CSV sample.
This command will search a given directory and produce a report of all files based on their file extension. This command is only available in PowerShell 7.
23
+
24
+
## EXAMPLES
25
+
26
+
### Example 1
27
+
28
+
```powershell
29
+
PS C:\> Get-FileExtensionInfo c:\work
30
+
31
+
Path: C:\work [THINKP1]
32
+
33
+
Extension Count TotalSize Smallest Average Largest
The extension with the largest total size will be highlighted in color.
61
+
62
+
## PARAMETERS
63
+
64
+
### -Hidden
65
+
66
+
Include files in hidden folders
67
+
68
+
```yaml
69
+
Type: SwitchParameter
70
+
Parameter Sets: (All)
71
+
Aliases:
72
+
73
+
Required: False
74
+
Position: Named
75
+
Default value: None
76
+
Accept pipeline input: False
77
+
Accept wildcard characters: False
78
+
```
79
+
80
+
### -IncludeFiles
81
+
82
+
Add the corresponding collection of files. You can access these items by the Files property.
83
+
84
+
```yaml
85
+
Type: SwitchParameter
86
+
Parameter Sets: (All)
87
+
Aliases:
88
+
89
+
Required: False
90
+
Position: Named
91
+
Default value: None
92
+
Accept pipeline input: False
93
+
Accept wildcard characters: False
94
+
```
95
+
96
+
### -Path
97
+
98
+
Specify the root directory path to search
99
+
100
+
```yaml
101
+
Type: String
102
+
Parameter Sets: (All)
103
+
Aliases:
104
+
105
+
Required: False
106
+
Position: 0
107
+
Default value: None
108
+
Accept pipeline input: False
109
+
Accept wildcard characters: False
110
+
```
111
+
112
+
### -Recurse
113
+
114
+
Recurse through all folders.
115
+
116
+
```yaml
117
+
Type: SwitchParameter
118
+
Parameter Sets: (All)
119
+
Aliases:
120
+
121
+
Required: False
122
+
Position: Named
123
+
Default value: None
124
+
Accept pipeline input: False
125
+
Accept wildcard characters: False
126
+
```
127
+
128
+
### CommonParameters
129
+
130
+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
131
+
132
+
## INPUTS
133
+
134
+
### None
135
+
136
+
## OUTPUTS
137
+
138
+
### FileExtensionInfo
139
+
140
+
## NOTES
141
+
142
+
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/
0 commit comments