forked from jdhitsolutions/PSScriptTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConvert-HashtableString.yml
More file actions
60 lines (48 loc) · 1.77 KB
/
Copy pathConvert-HashtableString.yml
File metadata and controls
60 lines (48 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
examples:
- name: Example 1
preCode: ''
code: >-
PS C:\> get-content c:\work\test.psd1 | unprotect-cmsmessage | Convert-HashtableString
Name Value
---- -----
CreatedBy BOVINE320\Jeff
CreatedAt 10/02/2018 21:28:47 UTC
Computername Think51
Error
Completed True
Date 10/02/2018 21:29:35 UTC
Scriptblock restart-service spooler -force
CreatedOn BOVINE320
postCode: The test.psd1 file is protected as a CMS Message. In this example, the contents are decoded as a string which is then in turn converted into an actual hashtable.
inputs:
- type: System.String
description: ''
links:
- href: https://github.com/jdhitsolutions/PSScriptTools/blob/master/docs/Convert-HashtableString.md
text: 'Online Version:'
- href: ''
text: Import-PowerShellDatafile
- href: ./Convert-HashtabletoCode.md
text: Convert-HashtabletoCode
module:
name: PSScriptTools
name: Convert-HashtableString
notes: 'Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/'
optionalParameters: []
outputs:
- type: '[hashtable]'
description: ''
requiredParameters:
- name: Text
aliases: []
defaultValue: None
description: Enter your hashtable string.
parameterValueGroup: []
pipelineInput: True (ByValue)
position: 0
type: String
remarks: This function is similar to Import-PowerShellDataFile. But where that command can only process a file, this command will take any hashtable-formatted string and convert it into an actual hashtable.
summary: Convert a hashtable string into a hashtable object.
syntaxes:
- parameters:
- Text