Skip to content

Commit 289466e

Browse files
authored
[WindowsIoTServices] Init. (#13564)
* [WindowsIoTServices] Init. * [WindowsIotServices]Update readme.md file.
1 parent 41114db commit 289466e

31 files changed

+2393
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

src/WindowsIotServices/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
custom/*.psm1
9+
test/*-TestResults.xml
10+
/*.ps1
11+
/*.ps1xml
12+
/*.psm1
13+
/*.snk
14+
/*.csproj
15+
/*.nuspec
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@{
2+
GUID = 'd5c7f2ce-fe23-49d5-a869-fb780e78a663'
3+
RootModule = './Az.WindowsIotServices.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: WindowsIotServices cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.WindowsIotServices.private.dll'
13+
FormatsToProcess = './Az.WindowsIotServices.format.ps1xml'
14+
FunctionsToExport = 'Get-AzWindowsIotServicesDevice', 'New-AzWindowsIotServicesDevice', 'Remove-AzWindowsIotServicesDevice', 'Update-AzWindowsIotServicesDevice', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
17+
PSData = @{
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'WindowsIotServices'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
24+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Custom
2+
This directory contains custom implementation for non-generated cmdlets for the `Az.WindowsIotServices` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.WindowsIotServices.custom.psm1`. This file should not be modified.
3+
4+
## Info
5+
- Modifiable: yes
6+
- Generated: partial
7+
- Committed: yes
8+
- Packaged: yes
9+
10+
## Details
11+
For `Az.WindowsIotServices` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
12+
13+
For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.WindowsIotServices.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
14+
15+
For script cmdlets, these are loaded via the `Az.WindowsIotServices.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
16+
17+
## Purpose
18+
This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
19+
20+
## Usage
21+
The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
22+
- Break
23+
- DefaultProfile
24+
- HttpPipelineAppend
25+
- HttpPipelinePrepend
26+
- Proxy
27+
- ProxyCredential
28+
- ProxyUseDefaultCredentials
29+
30+
These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.WindowsIotServices`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
31+
32+
### Attributes
33+
For processing the cmdlets, we've created some additional attributes:
34+
- `Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.DescriptionAttribute`
35+
- Used in C# cmdlets to provide a high-level description of the cmdlet. This is propegated to reference documentation via [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
36+
- `Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.DoNotExportAttribute`
37+
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.WindowsIotServices`.
38+
- `Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.InternalExportAttribute`
39+
- Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.WindowsIotServices`. For more information, see [readme.md](..\internal/readme.md) in the `..\internal` folder.
40+
- `Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.ProfileAttribute`
41+
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
Module Name: Az.WindowsIotServices
3+
Module Guid: d5c7f2ce-fe23-49d5-a869-fb780e78a663
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.windowsiotservices
5+
Help Version: 1.0.0.0
6+
Locale: en-US
7+
---
8+
9+
# Az.WindowsIotServices Module
10+
## Description
11+
Microsoft Azure PowerShell: WindowsIotServices cmdlets
12+
13+
## Az.WindowsIotServices Cmdlets
14+
### [Get-AzWindowsIotServicesDevice](Get-AzWindowsIotServicesDevice.md)
15+
Get the non-security related metadata of a Windows IoT Device Service.
16+
17+
### [New-AzWindowsIotServicesDevice](New-AzWindowsIotServicesDevice.md)
18+
Create or update the metadata of a Windows IoT Device Service.
19+
The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to update the Windows IoT Device Service.
20+
21+
### [Remove-AzWindowsIotServicesDevice](Remove-AzWindowsIotServicesDevice.md)
22+
Delete a Windows IoT Device Service.
23+
24+
### [Update-AzWindowsIotServicesDevice](Update-AzWindowsIotServicesDevice.md)
25+
Updates the metadata of a Windows IoT Device Service.
26+
The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to update the Windows IoT Device Service.
27+
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
---
2+
external help file:
3+
Module Name: Az.WindowsIotServices
4+
online version: https://docs.microsoft.com/en-us/powershell/module/az.windowsiotservices/get-azwindowsiotservicesdevice
5+
schema: 2.0.0
6+
---
7+
8+
# Get-AzWindowsIotServicesDevice
9+
10+
## SYNOPSIS
11+
Get the non-security related metadata of a Windows IoT Device Service.
12+
13+
## SYNTAX
14+
15+
### List1 (Default)
16+
```
17+
Get-AzWindowsIotServicesDevice [-SubscriptionId <String[]>] [-DefaultProfile <PSObject>] [<CommonParameters>]
18+
```
19+
20+
### Get
21+
```
22+
Get-AzWindowsIotServicesDevice -Name <String> -ResourceGroupName <String> [-SubscriptionId <String[]>]
23+
[-DefaultProfile <PSObject>] [<CommonParameters>]
24+
```
25+
26+
### GetViaIdentity
27+
```
28+
Get-AzWindowsIotServicesDevice -InputObject <IWindowsIotServicesIdentity> [-DefaultProfile <PSObject>]
29+
[<CommonParameters>]
30+
```
31+
32+
### List
33+
```
34+
Get-AzWindowsIotServicesDevice -ResourceGroupName <String> [-SubscriptionId <String[]>]
35+
[-DefaultProfile <PSObject>] [<CommonParameters>]
36+
```
37+
38+
## DESCRIPTION
39+
Get the non-security related metadata of a Windows IoT Device Service.
40+
41+
## EXAMPLES
42+
43+
### Example 1: Get all Windows IoT services under a subscription
44+
```powershell
45+
PS C:\> Get-AzWindowsIotServicesDevice
46+
47+
Location Name Type Etag
48+
-------- ---- ---- ----
49+
West US wsi-t01 Microsoft.WindowsIoT/DeviceServices "5c006e63-0000-0700-0000-5faa37830000"
50+
eastus wsi-t02 Microsoft.WindowsIoT/DeviceServices "5c006ad2-0000-0700-0000-5faa3e090000"
51+
```
52+
53+
This command gets all Windows IoT services under a subscription.
54+
55+
### Example 2: Get all Windows IoT services under a resource group
56+
```powershell
57+
PS C:\> Get-AzWindowsIotServicesDevice -ResourceGroupName azure-rg-test
58+
59+
Location Name Type Etag
60+
-------- ---- ---- ----
61+
West US wsi-t01 Microsoft.WindowsIoT/DeviceServices "5c006e63-0000-0700-0000-5faa37830000"
62+
eastus wsi-t02 Microsoft.WindowsIoT/DeviceServices "5c006ad2-0000-0700-0000-5faa3e090000"
63+
```
64+
65+
This command gets all Windows IoT services under a resource group.
66+
67+
### Example 3: Get a Windows IoT service by name
68+
```powershell
69+
PS C:\> Get-AzWindowsIotServicesDevice -ResourceGroupName azure-rg-test -Name wsi-t01
70+
71+
Location Name Type Etag
72+
-------- ---- ---- ----
73+
West US wsi-t01 Microsoft.WindowsIoT/DeviceServices "5c006e63-0000-0700-0000-5faa37830000"
74+
```
75+
76+
This command gets a Windows IoT service by name.
77+
78+
### Example 4: Get a Windows IoT service by object
79+
```powershell
80+
PS C:\> $wsi = New-AzWindowsIotServicesDevice -Name wsi-t01 -ResourceGroupName azure-rg-test -Location eastus -Quantity 10 -BillingDomainName 'microsoft.onmicrosoft.com' -AdminDomainName 'microsoft.onmicrosoft.com'
81+
PS C:\> Get-AzWindowsIotServicesDevice -InputObject $wsi
82+
83+
Location Name Type Etag
84+
-------- ---- ---- ----
85+
West US wsi-t01 Microsoft.WindowsIoT/DeviceServices "5c006e63-0000-0700-0000-5faa37830000"
86+
```
87+
88+
This command gets a Windows IoT service by object.
89+
90+
### Example 4: Get a Windows IoT service by pipeline
91+
```powershell
92+
PS C:\> $wsi = New-AzWindowsIotServicesDevice -Name wsi-t01 -ResourceGroupName azure-rg-test -Location eastus -Quantity 10 -BillingDomainName 'microsoft.onmicrosoft.com' -AdminDomainName 'microsoft.onmicrosoft.com' | Get-AzWindowsIotServicesDevice
93+
94+
Location Name Type Etag
95+
-------- ---- ---- ----
96+
West US wsi-t01 Microsoft.WindowsIoT/DeviceServices "5c006e63-0000-0700-0000-5faa37830000"
97+
```
98+
99+
This command gets a Windows IoT service by pipeline.
100+
101+
## PARAMETERS
102+
103+
### -DefaultProfile
104+
The credentials, account, tenant, and subscription used for communication with Azure.
105+
106+
```yaml
107+
Type: System.Management.Automation.PSObject
108+
Parameter Sets: (All)
109+
Aliases: AzureRMContext, AzureCredential
110+
111+
Required: False
112+
Position: Named
113+
Default value: None
114+
Accept pipeline input: False
115+
Accept wildcard characters: False
116+
```
117+
118+
### -InputObject
119+
Identity Parameter
120+
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
121+
122+
```yaml
123+
Type: Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.IWindowsIotServicesIdentity
124+
Parameter Sets: GetViaIdentity
125+
Aliases:
126+
127+
Required: True
128+
Position: Named
129+
Default value: None
130+
Accept pipeline input: True (ByValue)
131+
Accept wildcard characters: False
132+
```
133+
134+
### -Name
135+
The name of the Windows IoT Device Service.
136+
137+
```yaml
138+
Type: System.String
139+
Parameter Sets: Get
140+
Aliases:
141+
142+
Required: True
143+
Position: Named
144+
Default value: None
145+
Accept pipeline input: False
146+
Accept wildcard characters: False
147+
```
148+
149+
### -ResourceGroupName
150+
The name of the resource group that contains the Windows IoT Device Service.
151+
152+
```yaml
153+
Type: System.String
154+
Parameter Sets: Get, List
155+
Aliases:
156+
157+
Required: True
158+
Position: Named
159+
Default value: None
160+
Accept pipeline input: False
161+
Accept wildcard characters: False
162+
```
163+
164+
### -SubscriptionId
165+
The subscription identifier.
166+
167+
```yaml
168+
Type: System.String[]
169+
Parameter Sets: Get, List, List1
170+
Aliases:
171+
172+
Required: False
173+
Position: Named
174+
Default value: (Get-AzContext).Subscription.Id
175+
Accept pipeline input: False
176+
Accept wildcard characters: False
177+
```
178+
179+
### CommonParameters
180+
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).
181+
182+
## INPUTS
183+
184+
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.IWindowsIotServicesIdentity
185+
186+
## OUTPUTS
187+
188+
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.Api20190601.IDeviceService
189+
190+
## NOTES
191+
192+
ALIASES
193+
194+
COMPLEX PARAMETER PROPERTIES
195+
196+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
197+
198+
199+
INPUTOBJECT <IWindowsIotServicesIdentity>: Identity Parameter
200+
- `[DeviceName <String>]`: The name of the Windows IoT Device Service.
201+
- `[Id <String>]`: Resource identity path
202+
- `[ResourceGroupName <String>]`: The name of the resource group that contains the Windows IoT Device Service.
203+
- `[SubscriptionId <String>]`: The subscription identifier.
204+
205+
## RELATED LINKS
206+

0 commit comments

Comments
 (0)