|
15 | 15 |
|
16 | 16 | <#
|
17 | 17 | .SYNOPSIS
|
18 |
| -Gets valid Device Connection String |
| 18 | +Gets valid resource group name |
19 | 19 | #>
|
| 20 | +function Get-DeviceResourceGroupName |
| 21 | +{ |
| 22 | + return "psrgpfortest" |
| 23 | +} |
20 | 24 |
|
21 |
| -function Get-DeviceConnectionString |
| 25 | +<# |
| 26 | +.SYNOPSIS |
| 27 | +Gets valid resource name |
| 28 | +#> |
| 29 | +function Get-DeviceName |
22 | 30 | {
|
23 |
| - return ""; |
| 31 | + return "psddataboxedgecan" |
24 | 32 | }
|
25 | 33 |
|
26 | 34 | <#
|
27 | 35 | .SYNOPSIS
|
28 |
| -Gets valid IOT Device Connection String |
| 36 | +Gets valid resource name |
29 | 37 | #>
|
30 |
| -function Get-IotDeviceConnectionString |
| 38 | +function Get-VaultName |
31 | 39 | {
|
32 |
| - return ""; |
| 40 | + return "azpsdbe" |
33 | 41 | }
|
34 | 42 |
|
| 43 | + |
35 | 44 | <#
|
36 | 45 | .SYNOPSIS
|
37 |
| -Returns Userpassword used for password |
38 |
| -Gets valid resource group name |
39 |
| - #> |
40 |
| -function Get-Userpassword |
| 46 | +Gets valid Device Connection String |
| 47 | +#> |
| 48 | + |
| 49 | +function Get-DeviceConnectionString |
41 | 50 | {
|
42 |
| - return ""; |
| 51 | + $vaultName = Get-VaultName |
| 52 | + $val = Get-AzKeyVaultSecret -VaultName $vaultName -Name "DeviceConnectionString" |
| 53 | + return $val.SecretValue |
43 | 54 | }
|
44 | 55 |
|
45 | 56 | <#
|
46 | 57 | .SYNOPSIS
|
47 |
| -Returns standard EncryptionKey |
| 58 | +Gets valid IOT Device Connection String |
48 | 59 | #>
|
49 |
| -function Get-EncryptionKey |
| 60 | +function Get-IotDeviceConnectionString |
50 | 61 | {
|
51 |
| - $encryptionKey = ConvertTo-SecureString -String "" |
52 |
| - return $encryptionKey |
| 62 | + $vaultName = Get-VaultName |
| 63 | + $val = Get-AzKeyVaultSecret -VaultName $vaultName -Name "IotDeviceConnectionString" |
| 64 | + return $val.SecretValue |
53 | 65 | }
|
54 | 66 |
|
55 | 67 | <#
|
56 | 68 | .SYNOPSIS
|
| 69 | +Returns Userpassword used for password |
57 | 70 | Gets valid resource group name
|
58 |
| -#> |
59 |
| -function Get-DeviceResourceGroupName |
| 71 | + #> |
| 72 | +function Get-Userpassword |
60 | 73 | {
|
61 |
| - return "psrgpfortest" |
| 74 | + $vaultName = Get-VaultName |
| 75 | + $val = Get-AzKeyVaultSecret -VaultName $vaultName -Name "UserPassword" |
| 76 | + return $val.SecretValue |
62 | 77 | }
|
63 | 78 |
|
64 | 79 | <#
|
65 | 80 | .SYNOPSIS
|
66 |
| -Gets valid resource name |
| 81 | +Returns standard EncryptionKey |
67 | 82 | #>
|
68 |
| -function Get-DeviceName |
| 83 | +function Get-EncryptionKey |
69 | 84 | {
|
70 |
| - return "psdataboxedgedevice" |
| 85 | + $val = "faked" |
| 86 | + return ConvertTo-SecureString $val -AsPlainText -Force |
71 | 87 | }
|
72 | 88 |
|
73 | 89 |
|
| 90 | + |
74 | 91 | function Get-StringHash([String] $String,$HashName = "MD5")
|
75 | 92 | {
|
76 | 93 | $StringBuilder = New-Object System.Text.StringBuilder
|
|
0 commit comments