Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
abbgrade committed Feb 20, 2022
2 parents 966fd9e + 2a4fa1a commit d1caa4e
Show file tree
Hide file tree
Showing 8 changed files with 313 additions and 26 deletions.
1 change: 1 addition & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"group": "test",
"type": "shell",
"command": "Invoke-Pester",
"args": ["-Output", "Detailed"],
"options": {
"cwd": "test"
},
Expand Down
21 changes: 14 additions & 7 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ Invoke-Build Install

### 0.1.0

- Added commands to connect, disconnect and query cosmos db.
- Added commands to connect, disconnect and query Cosmos DB.

### 0.2.0

- Added help / documentation to the commands.

## Development

Expand All @@ -45,9 +49,12 @@ You can build the module using the VS Code build task or with the command `Invok

### Release

1. Create release branch using gitflow.
2. Update version number in psd1 file.
3. Update changelog in this readme file.
4. Uninstall old versions.
5. publish release using `Invoke-Build Publish -Configuration Release`.
6. finish release using gitflow.
1. Create a release branch using gitflow.
2. Update the version number in the module manifest.
3. Extend the changelog in this readme.
4. If you want to create a prerelease.
1. Push the release branch to github, to publish the prerelease to PsGallery.
5. Finish release using gitflow.
6. Check if tags are not pushed to github.
7. Check if the release branch is deleted on github.
8. Create the release on github.
77 changes: 77 additions & 0 deletions docs/Connect-CSqlInstance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
external help file: PsCosmos.dll-Help.xml
Module Name: PsCosmos
online version:
schema: 2.0.0
---

# Connect-CSqlInstance

## SYNOPSIS
Creates a connection to a CosmosDb instance.

## SYNTAX

```
Connect-CSqlInstance [-Endpoint] <String> [-ReadKey] <String> [<CommonParameters>]
```

## DESCRIPTION
Cosmos SQL queries require a authenticated client, which is created by this command using a CosmosDb instance endpoint and a ReadKey.
The latest created connection is used as default connection for other commands, that require a connection.

## EXAMPLES

### Example 1
```powershell
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -Endpoint
Specifies the endpoint, that is required to identify the CosmosDb instance.

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

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```
### -ReadKey
Specifies the key, to authenticate the client.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```
### CommonParameters
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).
## INPUTS
### System.String
## OUTPUTS
### Microsoft.Azure.Cosmos.CosmosClient
## NOTES
## RELATED LINKS
60 changes: 60 additions & 0 deletions docs/Disconnect-CSqlInstance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
external help file: PsCosmos.dll-Help.xml
Module Name: PsCosmos
online version:
schema: 2.0.0
---

# Disconnect-CSqlInstance

## SYNOPSIS

Disposes a CosmosDb connection.

## SYNTAX

```
Disconnect-CSqlInstance [-Client <CosmosClient>] [<CommonParameters>]
```

## DESCRIPTION
Disposes a CosmosDb connection and removes it as default from other commands.

## EXAMPLES

### Example 1
```powershell
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -Client
Specifies the connection to Cosmos Db. If not specified, the last connected instance is used.

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

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```
### CommonParameters
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).
## INPUTS
### Microsoft.Azure.Cosmos.CosmosClient
## OUTPUTS
## NOTES
## RELATED LINKS
126 changes: 126 additions & 0 deletions docs/Invoke-CSqlQuery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
external help file: PsCosmos.dll-Help.xml
Module Name: PsCosmos
online version:
schema: 2.0.0
---

# Invoke-CSqlQuery

## SYNOPSIS
Queries a CosmosDb using SQL.

## SYNTAX

```
Invoke-CSqlQuery [-Text] <String> [-Client <CosmosClient>] -Database <String> -Container <String>
[-Timeout <Int32>] [<CommonParameters>]
```

## DESCRIPTION
Executes a Cosmos SQL query and returns the result as PowerShell objects.

## EXAMPLES

### Example 1
```powershell
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -Client
Specifies the connection to Cosmos Db. If not specified, the last connected instance is used.

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

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```
### -Container
Specifies the container to execute the query in.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -Database
Specifies the database to execute the query in.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -Text
Specifies the SQL query text.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -Timeout
Specifies a timeout for the query in seconds. If not specified, no timeout is used.
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### CommonParameters
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).
## INPUTS
### System.String
### Microsoft.Azure.Cosmos.CosmosClient
### System.Int32
## OUTPUTS
### System.Management.Automation.PSObject
## NOTES
## RELATED LINKS
4 changes: 4 additions & 0 deletions src/PsCosmos/DisconnectInstanceCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace PsCosmos
{
[Cmdlet(VerbsCommunications.Disconnect, "Instance")]
[OutputType(typeof(void))]
public class DisconnectInstanceCommand : PSCmdlet
{

Expand All @@ -16,6 +17,9 @@ public class DisconnectInstanceCommand : PSCmdlet

protected override void ProcessRecord()
{
if ( Client.Equals(ConnectInstanceCommand.SessionClient)) {
ConnectInstanceCommand.SessionClient = null;
}
Client.Dispose();
}

Expand Down
2 changes: 1 addition & 1 deletion src/PsCosmos/PsCosmos.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PsCosmos.dll'

# Version number of this module.
ModuleVersion = '0.1.0'
ModuleVersion = '0.2.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Loading

0 comments on commit d1caa4e

Please sign in to comment.