Skip to content

Commit 1ce78c2

Browse files
see changelog for v2.2.0
1 parent f5cfbed commit 1ce78c2

31 files changed

Lines changed: 427 additions & 209 deletions

PSScriptTools.psd1

1.93 KB
Binary file not shown.

README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ or in PowerShell Core:
1616
Install-Module PSScriptTools -scope currentuser
1717
```
1818

19-
Please post any questions, problems or feedback in Issues. Any input is greatly appreciated.
19+
Starting in v2.2.0, the module was restructured to better support Desktop and Core editions. It is recommended that you uninstall any version older than 2.2.0 and then install the latest version from the PowerShell Gallery.
20+
21+
```powershell
22+
Uninstall-Module PSScriptTools -allversions
23+
```
24+
Any command that uses WPF will not run on PowerShell Core and is not exported.
25+
26+
Please post any questions, problems or feedback in [Issues](https://github.com/jdhitsolutions/PSScriptTools/issues). Any input is greatly appreciated.
2027

2128
## [Add-Border](docs/Add-Border.md)
2229

@@ -565,20 +572,20 @@ Use this command to compare module versions between what is installed against an
565572
PS C:\> Compare-Module | Where UpdateNeeded | Out-Gridview -title "Select modules to update" -outputMode multiple | Foreach { Update-Module $_.name }
566573
```
567574

568-
Compare modules and send results to Out-Gridview. Use Out-Gridview as an object picker to decide what modules to update.
575+
Compare modules and send results to `Out-Gridview`. Use `Out-Gridview` as an object picker to decide what modules to update.
569576

570577
## [Get-WindowsVersion](docs/Get-WindowsVersion.md)
571578

572579
This is a PowerShell version of the `winver.exe` utility. This command uses PowerShell remoting to query the registry on a remote machine to retrieve Windows version information.
573580

574581
```powershell
575-
PS C:\> get-windowsversion -Computername srv1,srv2,win10 -Credential company\artd | format-table
582+
PS C:\> get-windowsversion -Computername srv1,srv2,win10 -Credential company\artd
576583
577-
ProductName EditionID ReleaseId Build InstalledUTC Computername
578-
----------- --------- --------- ----- ------------ ------------
579-
Windows Server 2016 Standard Evaluation ServerStandardEval 1607 14393.2273 12/26/2018 4:07:25 PM SRV1
580-
Windows Server 2016 Standard Evaluation ServerStandardEval 1607 14393.2273 12/26/2018 4:08:07 PM SRV2
581-
Windows 10 Enterprise Evaluation EnterpriseEval 1703 15063.1387 12/26/2018 4:08:11 PM WIN10
584+
ProductName EditionID ReleaseId Build InstalledUTC Computername
585+
----------- --------- --------- ----- ------------ ------------
586+
Windows Server 2016 Standard ServerStandardEval 1607 14393.2273 12/26/2018 4:07:25 PM SRV1
587+
Windows Server 2016 Standard ServerStandardEval 1607 14393.2273 12/26/2018 4:08:07 PM SRV2
588+
Windows 10 Enterprise Evaluat EnterpriseEval 1703 15063.1387 12/26/2018 4:08:11 PM WIN10
582589
```
583590

584591
### [Get-WindowsVersionString](docs/Get-WindowsVersionString.md)
@@ -587,7 +594,8 @@ This command is a variation of `Get-WindowsVersion` that returns a formatted str
587594

588595
```powershell
589596
PS C:\> Get-WindowsVersionString
590-
Windows 10 Pro Version 1809 (OS Build 17763.195)
597+
BOVINE320 Windows 10 Pro Version Professional (OS Build 17763.253)
598+
591599
```
592600

593601
## [New-PSFormatXML](docs/New-PSFormatXML.md)
@@ -679,11 +687,12 @@ Position : Named
679687
ValueFromPipeline : False
680688
ValueFromPipelineByPropertyName : False
681689
Type : System.String[]
690+
IsDynamic : False
682691
ParameterSet : __AllParameterSets
683692
```
684693

685694
## Compatibility
686695

687696
Where possible these commands have been tested with PowerShell Core, but not every platform. If you encounter problems, have suggestions or other feedback, please post an issue.
688697

689-
*last updated 17 February 2019*
698+
*last updated 21 February 2019*

changelog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Change Log for PSScriptTools
22

3+
## v2.2.0
4+
5+
+ Code revisions in `ConvertTo-WPFGrid` (Issue #27)
6+
+ Updated `Get-ParameterInfo` to reflect dynamic parameters (Issue #28)
7+
+ Updated `Get-PSLocation` to better reflect locations and use a custom format file.
8+
+ Updated `Get-WindowsVersion` with custom type for format file. Also better handling of non-Windows platforms.
9+
+ Updated `Get-WindowsVersionString` to include the computername.
10+
+ Updated `New-WPFMessageBox` to gracefully exit if running on PowerShell Core.
11+
+ Updated `Test-ExpressionForm` to gracefully exit if running on PowerShell Core.
12+
+ Updated `New-RandomFilename` to better reflect locations using `[environment]`
13+
+ Modified manifest to be more aware of PSEdition and only load compatible commands.
14+
+ Help updates
15+
+ Updated `README.md`
16+
317
## v2.1.0
418

519
+ Added parameter to allow user to specify a type name with `New-PSFormatXML` (Issue #26)

docs/Add-Border.md

Lines changed: 3 additions & 4 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:
55
schema: 2.0.0
66
---
77

@@ -27,8 +27,7 @@ Add-Border [-TextBlock] <String[]> [-Character <String>] [-InsertBlanks] [-Tab <
2727

2828
## DESCRIPTION
2929

30-
This command will create a character or text based border around a line of text.
31-
You might use this to create a formatted text report or to improve the display of information to the screen.
30+
This command will create a character or text based border around a line of text. You might use this to create a formatted text report or to improve the display of information to the screen.
3231

3332
## EXAMPLES
3433

@@ -140,7 +139,7 @@ Insert blank lines before and after the text. The default behavior is to create
140139
```yaml
141140
Type: SwitchParameter
142141
Parameter Sets: (All)
143-
Aliases:
142+
Aliases:
144143

145144
Required: False
146145
Position: Named

docs/Convert-HashtableString.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell
7979
8080
## RELATED LINKS
8181
82-
[Import-PowerShellDatafile]())
82+
[Import-PowerShellDatafile]()
8383
8484
[Convert-HashtabletoCode](./Convert-HashtabletoCode.md)

docs/ConvertTo-HashTable.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,3 @@ This was originally described at: http://jdhitsolutions.com/blog/2013/01/convert
164164
[About_Hash_Tables]()
165165
166166
[Get-Member]()
167-

docs/ConvertTo-WPFGrid.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ConvertTo-WPFGrid [[-InputObject] <PSObject>] [[-Title] <String>] [[-Timeout] <I
2222

2323
This command is an alternative to Out-Gridview. It works much the same way. Run a PowerShell command and pipe it to this command. The output will be displayed in an autosized data grid. You can click on column headings to sort. You can resize columns and you can re-order columns. You will want to be selective about which properties you pipe through to this command. See examples.
2424

25-
You can specify a timeout value which will automatically close the form. If you specify a timeout and the Refresh parameter, then the contents of the datagrid will automatically refreshed using the timeout value as an integer. This will only work when you pipe a PowerShell expression to ConvertTo-WPFGrid.
25+
You can specify a timeout value which will automatically close the form. If you specify a timeout and the Refresh parameter, then the contents of the datagrid will automatically refreshed using the timeout value as an integer. This will only work when you pipe a PowerShell expression to ConvertTo-WPFGrid as one command. This will fail if you break the command in the PowerShell ISE or use a nested prompt.
2626

2727
This command runs the WPF grid in a new runspace so your PowerShell prompt will not be blocked. However, after closing the form you may be left with the runspace. You can use Remove-Runspace to clean up or wait until you restart PowerShell.
2828

@@ -46,7 +46,7 @@ PS C:\> Get-VM -computername $VMHost | Select Name,State,Uptime,
4646
ConvertTo-WPFGrid -title "VM Report $VMHost" -timeout 20
4747
```
4848

49-
Get Hyper-V virtual machine information and display for 20 seconds before automatically closing.
49+
Get Hyper-V virtual machine information and display for 20 seconds before automatically closing. Note that this would be written as one long pipelined expression. It is formatted here for the sake of the help documentation.
5050

5151
## PARAMETERS
5252

@@ -84,8 +84,7 @@ Accept wildcard characters: False
8484
8585
### -Timeout
8686
87-
By default the grid will remain displayed until you manually close it. But you can specify a timeout interval in seconds.
88-
The minimum accepted value is 5 seconds. If you use this parameter with -Refresh, then the datagrid will be refreshed with results of the PowerShell expression you piped to ConvertTo-WPFGrid.
87+
By default the grid will remain displayed until you manually close it. But you can specify a timeout interval in seconds. The minimum accepted value is 5 seconds. If you use this parameter with -Refresh, then the datagrid will be refreshed with results of the PowerShell expression you piped to ConvertTo-WPFGrid.
8988
9089
```yaml
9190
Type: Int32

docs/Copy-Command.md

Lines changed: 2 additions & 3 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:
55
schema: 2.0.0
66
---
77

@@ -150,5 +150,4 @@ Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell
150150
151151
## RELATED LINKS
152152
153-
[Get-Command]()
154-
153+
[Get-Command]()

docs/Find-CimClass.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Find-CimClass [-Classname] <String> [-Exclude <String>] [-Computername <String>]
1919

2020
## DESCRIPTION
2121

22-
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.
22+
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.
2323

2424
## EXAMPLES
2525

docs/Get-MyVariable.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,8 @@ You can then import this xml file in another session to restore these variables.
6767

6868
```powershell
6969
PS C:\> function foo { . c:\scripts\get-myvariable2.ps1;$a=4;$b=2;$c=$a*$b;get-MyVariable -notypeinformation -scope 1 -verbose;$c}
70-
```
71-
72-
This sample function dot sources the script with this function. Within the function, Get-MyVariable is called specifying scope 1, or the parent scope. Scope 0 would be the scope of the Get-MyVariable function. Here's the result.
7370
74-
PS S:\> foo
71+
PS C:\> foo
7572
VERBOSE: Getting system defined variables
7673
VERBOSE: Found 49
7774
VERBOSE: Getting current variables in 1 scope
@@ -85,6 +82,8 @@ b 2
8582
c 8
8683
VERBOSE: Finished getting my variables
8784
8
85+
```
86+
This sample function dot sources the script with this function. Within the function, Get-MyVariable is called specifying scope 1, or the parent scope. Scope 0 would be the scope of the Get-MyVariable function. Here's the result.
8887

8988
### EXAMPLE 5
9089

0 commit comments

Comments
 (0)