Skip to content

Commit

Permalink
see changelog for v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Feb 21, 2019
1 parent f5cfbed commit 1ce78c2
Show file tree
Hide file tree
Showing 31 changed files with 427 additions and 209 deletions.
Binary file modified PSScriptTools.psd1
Binary file not shown.
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ or in PowerShell Core:
Install-Module PSScriptTools -scope currentuser
```

Please post any questions, problems or feedback in Issues. Any input is greatly appreciated.
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.

```powershell
Uninstall-Module PSScriptTools -allversions
```
Any command that uses WPF will not run on PowerShell Core and is not exported.

Please post any questions, problems or feedback in [Issues](https://github.com/jdhitsolutions/PSScriptTools/issues). Any input is greatly appreciated.

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

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

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

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

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.

```powershell
PS C:\> get-windowsversion -Computername srv1,srv2,win10 -Credential company\artd | format-table
PS C:\> get-windowsversion -Computername srv1,srv2,win10 -Credential company\artd
ProductName EditionID ReleaseId Build InstalledUTC Computername
----------- --------- --------- ----- ------------ ------------
Windows Server 2016 Standard Evaluation ServerStandardEval 1607 14393.2273 12/26/2018 4:07:25 PM SRV1
Windows Server 2016 Standard Evaluation ServerStandardEval 1607 14393.2273 12/26/2018 4:08:07 PM SRV2
Windows 10 Enterprise Evaluation EnterpriseEval 1703 15063.1387 12/26/2018 4:08:11 PM WIN10
ProductName EditionID ReleaseId Build InstalledUTC Computername
----------- --------- --------- ----- ------------ ------------
Windows Server 2016 Standard ServerStandardEval 1607 14393.2273 12/26/2018 4:07:25 PM SRV1
Windows Server 2016 Standard ServerStandardEval 1607 14393.2273 12/26/2018 4:08:07 PM SRV2
Windows 10 Enterprise Evaluat EnterpriseEval 1703 15063.1387 12/26/2018 4:08:11 PM WIN10
```

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

```powershell
PS C:\> Get-WindowsVersionString
Windows 10 Pro Version 1809 (OS Build 17763.195)
BOVINE320 Windows 10 Pro Version Professional (OS Build 17763.253)
```

## [New-PSFormatXML](docs/New-PSFormatXML.md)
Expand Down Expand Up @@ -679,11 +687,12 @@ Position : Named
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Type : System.String[]
IsDynamic : False
ParameterSet : __AllParameterSets
```

## Compatibility

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.

*last updated 17 February 2019*
*last updated 21 February 2019*
14 changes: 14 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change Log for PSScriptTools

## v2.2.0

+ Code revisions in `ConvertTo-WPFGrid` (Issue #27)
+ Updated `Get-ParameterInfo` to reflect dynamic parameters (Issue #28)
+ Updated `Get-PSLocation` to better reflect locations and use a custom format file.
+ Updated `Get-WindowsVersion` with custom type for format file. Also better handling of non-Windows platforms.
+ Updated `Get-WindowsVersionString` to include the computername.
+ Updated `New-WPFMessageBox` to gracefully exit if running on PowerShell Core.
+ Updated `Test-ExpressionForm` to gracefully exit if running on PowerShell Core.
+ Updated `New-RandomFilename` to better reflect locations using `[environment]`
+ Modified manifest to be more aware of PSEdition and only load compatible commands.
+ Help updates
+ Updated `README.md`

## v2.1.0

+ Added parameter to allow user to specify a type name with `New-PSFormatXML` (Issue #26)
Expand Down
7 changes: 3 additions & 4 deletions docs/Add-Border.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: PSScriptTools-help.xml
Module Name: PSScriptTools
online version:
online version:
schema: 2.0.0
---

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

## DESCRIPTION

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.
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.

## EXAMPLES

Expand Down Expand Up @@ -140,7 +139,7 @@ Insert blank lines before and after the text. The default behavior is to create
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand Down
2 changes: 1 addition & 1 deletion docs/Convert-HashtableString.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell
## RELATED LINKS
[Import-PowerShellDatafile]())
[Import-PowerShellDatafile]()
[Convert-HashtabletoCode](./Convert-HashtabletoCode.md)
1 change: 0 additions & 1 deletion docs/ConvertTo-HashTable.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,3 @@ This was originally described at: http://jdhitsolutions.com/blog/2013/01/convert
[About_Hash_Tables]()
[Get-Member]()
7 changes: 3 additions & 4 deletions docs/ConvertTo-WPFGrid.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ConvertTo-WPFGrid [[-InputObject] <PSObject>] [[-Title] <String>] [[-Timeout] <I

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.

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.
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.

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.

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

Get Hyper-V virtual machine information and display for 20 seconds before automatically closing.
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.

## PARAMETERS

Expand Down Expand Up @@ -84,8 +84,7 @@ Accept wildcard characters: False
### -Timeout
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.
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.
```yaml
Type: Int32
Expand Down
5 changes: 2 additions & 3 deletions docs/Copy-Command.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: PSScriptTools-help.xml
Module Name: PSScriptTools
online version:
online version:
schema: 2.0.0
---

Expand Down Expand Up @@ -150,5 +150,4 @@ Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell
## RELATED LINKS
[Get-Command]()
[Get-Command]()
2 changes: 1 addition & 1 deletion docs/Find-CimClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Find-CimClass [-Classname] <String> [-Exclude <String>] [-Computername <String>]

## DESCRIPTION

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.
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.

## EXAMPLES

Expand Down
7 changes: 3 additions & 4 deletions docs/Get-MyVariable.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,8 @@ You can then import this xml file in another session to restore these variables.

```powershell
PS C:\> function foo { . c:\scripts\get-myvariable2.ps1;$a=4;$b=2;$c=$a*$b;get-MyVariable -notypeinformation -scope 1 -verbose;$c}
```

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.
PS S:\> foo
PS C:\> foo
VERBOSE: Getting system defined variables
VERBOSE: Found 49
VERBOSE: Getting current variables in 1 scope
Expand All @@ -85,6 +82,8 @@ b 2
c 8
VERBOSE: Finished getting my variables
8
```
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.

### EXAMPLE 5

Expand Down
10 changes: 5 additions & 5 deletions docs/Get-PSLocation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: PSScriptTools-help.xml
Module Name: PSScriptTools
online version:
online version:
schema: 2.0.0
---

Expand All @@ -26,7 +26,7 @@ This command will write an object to the pipeline that displays the values of co
### EXAMPLE 1

```powershell
PS C:\> get-pslocation | format-list
PS C:\> get-pslocation
Temp : C:\Users\Jeff\AppData\Local\Temp\
Home : C:\Users\Jeff\Documents
Expand All @@ -39,12 +39,12 @@ Results on a Windows system.
### EXAMPLE 2

```powershell
PS C:\> get-pslocation | format-list
PS C:\> get-pslocation
Temp : /tmp/
Home : /home/jhicks
Home : /home/jeff
Desktop :
PowerShell : /home/jhicks/.config/powershell
PowerShell : /home/jeff/.config/powershell
```

Results on a Linux system running PowerShell Core.
Expand Down
24 changes: 12 additions & 12 deletions docs/Get-PSWho.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: PSScriptTools-help.xml
Module Name: PSScriptTools
online version:
online version:
schema: 2.0.0
---

Expand All @@ -19,7 +19,7 @@ Get-PSWho [-AsString] [<CommonParameters>]

## DESCRIPTION

This command will provide a summary of relevant information for the current user in a PowerShell session. You might use this to troubleshoot an end-user problem running a script or command.
This command will provide a summary of relevant information for the current user in a PowerShell session. You might use this to troubleshoot an end-user problem running a script or command.

The default behavior is to write an object to the pipeline, but you can use the -AsString parameter to force the command to write a string. This makes it easier to use in your scripts with Write-Verbose.

Expand All @@ -33,9 +33,9 @@ PS C:\> Get-PSWho
User : BOVINE320\Jeff
Elevated : True
Computername : BOVINE320
OperatingSystem : Microsoft Windows 10 Pro \[64-bit\]
OSVersion : 10.0.16299
PSVersion : 5.1.16299.64
OperatingSystem : Microsoft Windows 10 Pro [64-bit]
OSVersion : 10.0.17763
PSVersion : 5.1.17763.134
Edition : Desktop
PSHost : ConsoleHost
WSMan : 3.0
Expand All @@ -51,14 +51,14 @@ PS /home/jhicks> Get-PSWho
User : jhicks
Elevated : NA
Computername : Bovine320
OperatingSystem : Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014
OSVersion : Ubuntu 16.04.3 LTS
PSVersion : 6.1.0
OperatingSystem : Linux 4.4.0-17763-Microsoft #253-Microsoft Mon Dec 31 17:49:00 PST 2018
OSVersion : Ubuntu 18.04.2 LTS
PSVersion : 6.1.2
Edition : Core
PSHost : ConsoleHost
WSMan : 3.0
ExecutionPolicy : Unrestricted
Culture : en-US
Culture : en-US-POSIX
```

### EXAMPLE 3
Expand Down Expand Up @@ -89,12 +89,12 @@ PS C:\> Get-PSWho -asString | Set-Content c:\test\who.txt

### -AsString

Write the summary object as a string.
Write the summary object as a string. This can be useful when you want to save the information in a log file.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand All @@ -113,7 +113,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### [PSCustomObject]
### PSWho
### [System.String]
Expand Down
9 changes: 9 additions & 0 deletions docs/Get-ParameterInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Position : 0
ValueFromPipeline : True
ValueFromPipelineByPropertyName : True
Type : System.String[]
IsDynamic : False
ParameterSet : Default
Name : ComputerName
Expand All @@ -45,6 +46,7 @@ Position : Named
ValueFromPipeline : False
ValueFromPipelineByPropertyName : True
Type : System.String[]
IsDynamic : False
ParameterSet : __AllParameterSets
Name : DependentServices
Expand All @@ -54,6 +56,7 @@ Position : Named
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Type : System.Management.Automation.SwitchParameter
IsDynamic : False
ParameterSet : __AllParameterSets
Name : RequiredServices
Expand All @@ -63,6 +66,7 @@ Position : Named
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Type : System.Management.Automation.SwitchParameter
IsDynamic : False
ParameterSet : __AllParameterSets
Name : DisplayName
Expand All @@ -72,6 +76,7 @@ Position : Named
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Type : System.String[]
IsDynamic : False
ParameterSet : DisplayName
Name : Include
Expand All @@ -81,6 +86,7 @@ Position : Named
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Type : System.String[]
IsDynamic : False
ParameterSet : __AllParameterSets
Name : Exclude
Expand All @@ -90,6 +96,7 @@ Position : Named
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Type : System.String[]
IsDynamic : False
ParameterSet : __AllParameterSets
Name : InputObject
Expand All @@ -99,6 +106,7 @@ Position : Named
ValueFromPipeline : True
ValueFromPipelineByPropertyName : False
Type : System.ServiceProcess.ServiceController[]
IsDynamic : False
ParameterSet : InputObject
```

Expand Down Expand Up @@ -167,6 +175,7 @@ Position : Named
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Type : System.String[]
IsDynamic : False
ParameterSet : __AllParameterSets
```

Expand Down
Loading

0 comments on commit 1ce78c2

Please sign in to comment.