You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Storage/how-to.md
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ To build, run the `build-module.ps1` at the root of the module directory. This w
8
8
To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [readme.md](custom/readme.md) in the `custom` folder.
9
9
10
10
## Generating documentation
11
-
To generate documentation, run the `generate-help.ps1` script. This will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [readme.md](examples/readme.md) in the `examples` folder. To read more about documentation, look at the [readme.md](docs/readme.md) in the `docs` folder.
11
+
To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [readme.md](examples/readme.md) in the `examples` folder. To read more about documentation, look at the [readme.md](docs/readme.md) in the `docs` folder.
12
12
13
13
## Testing `Az.Storage`
14
14
To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [readme.md](examples/readme.md) in the `examples` folder.
@@ -19,14 +19,16 @@ To pack `Az.Storage` for distribution, run the `pack-module.ps1` script. This wi
19
19
## Module Script Details
20
20
There are multiple scripts created for performing different actions for developing `Az.Storage`.
21
21
-`build-module.ps1`
22
-
- Builds the module DLL (`./bin/Az.Storage.private.dll`), creates the exported cmdlets, generates custom cmdlet test stubs, and updates `./Az.Storage.psd1` with Azure profile information.
22
+
- Builds the module DLL (`./bin/Az.Storage.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.Storage.psd1` with Azure profile information.
23
23
-**Parameters**: [`Switch` parameters]
24
24
-`-Run`: After building, creates an isolated PowerShell session and loads `Az.Storage`.
25
25
-`-Test`: After building, runs the `Pester` tests defined in the `test` folder.
26
26
-`-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder.
27
27
-`-Pack`: After building, packages the module into a `.nupkg`.
28
28
-`-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module.
29
29
-`-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration).
30
+
-`-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process.
31
+
-`-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process.
30
32
-`run-module.ps1`
31
33
- Creates an isolated PowerShell session and loads `Az.Storage` into the session.
32
34
- Same as `-Run` in `build-module.ps1`.
@@ -42,7 +44,15 @@ There are multiple scripts created for performing different actions for developi
42
44
-`pack-module.ps1`
43
45
- Packages the module into a `.nupkg` for distribution.
44
46
- Same as `-Pack` in `build-module.ps1`.
47
+
-`generate-help.ps1`
48
+
- Generates the Markdown documents for the modules into the `docs` folder.
49
+
- Same as `-Docs` in `build-module.ps1`.
50
+
- This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`.
51
+
-`export-surface.ps1`
52
+
- Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module.
53
+
- These files are placed into the `resources` folder.
54
+
- Used for investigating the surface of your module. These are *not* documentation for distribution.
45
55
-`check-dependencies.ps1`
46
-
- Used in `run-module.ps1`, `generate-help.ps1`, and `test-module.ps1` to verify dependent modules are available to run those tasks.
56
+
- Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks.
47
57
- It will download local (within the module's directory structure) versions of those modules as needed.
Copy file name to clipboardExpand all lines: src/Storage/test/readme.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ This directory contains the [Pester](https://www.powershellgallery.com/packages/
7
7
- Committed: yes
8
8
- Packaged: no
9
9
10
-
## Details (*WIP*)
11
-
We allow three testing modes: `live`, `record`, and `playback`.
10
+
## Details
11
+
We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file.
12
12
13
13
## Purpose
14
14
Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework.
15
15
16
-
## Usage (*WIP*)
17
-
This feature is currently a **work-in-progress**. It is able to create test recordings of the HTTP pipeline. However, folder structure, file names, and processes are being implemented.
16
+
## Usage
17
+
To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started.
0 commit comments