Skip to content

Commit 569b657

Browse files
authored
Removed unit test for prerelease version and VSCode temp folder (#129)
1 parent d9e3196 commit 569b657

4 files changed

Lines changed: 13 additions & 24 deletions

File tree

resources/Help/Microsoft.Dotnet.Dsc/DotNetToolPackage.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ The `DotNetToolPackage` DSC Resource allows you to install, update, and uninstal
1919

2020
## PARAMETERS
2121

22-
| **Parameter** | **Attribute** | **DataType** | **Description** | **Allowed Values** |
23-
| ------------------- | ------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
24-
| `PackageId` | Key | String | The ID of the .NET tool package to manage. | N/A |
25-
| `Version` | Optional | String | The version of the .NET tool package to install. If not specified, the latest version will be installed. | N/A |
26-
| `Commands` | Optional | String[] | An array of commands provided by the .NET tool package. | N/A |
27-
| `Prerelease` | Optional | Boolean | Indicates whether to include prerelease versions of the .NET tool package. The default value is `$false`. | `$true`, `$false` |
28-
| `ToolPathDirectory` | Optional | String | The directory where the .NET tool package will be installed. If not specified, the package will be installed globally. | Use custom directory when you have |
29-
| `Exist` | Optional | Boolean | Indicates whether the package should exist. Defaults to `$true`. | `$true` or `$false` |
22+
| **Parameter** | **Attribute** | **DataType** | **Description** | **Allowed Values** |
23+
| ------------------- | ------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
24+
| `PackageId` | Key | String | The ID of the .NET tool package to manage. | N/A |
25+
| `Version` | Optional | String | The version of the .NET tool package to install. If not specified, the latest version will be installed. | N/A |
26+
| `Commands` | Optional | String[] | An array of commands provided by the .NET tool package. | N/A |
27+
| `Prerelease` | Optional | Boolean | Indicates whether to include prerelease versions of the .NET tool package. The default value is `$false`. Note: If the prerelease version is lower than the current version, the highest version will be installed. | `$true`, `$false` |
28+
| `ToolPathDirectory` | Optional | String | The directory where the .NET tool package will be installed. If not specified, the package will be installed globally. | Use custom directory when you have |
29+
| `Exist` | Optional | Boolean | Indicates whether the package should exist. Defaults to `$true`. | `$true` or `$false` |
3030

3131
## EXAMPLES
3232

@@ -59,4 +59,5 @@ Invoke-DscResource -ModuleName Microsoft.DotNet.Dsc -Name DotNetToolPackage -Met
5959
}
6060
6161
# This example installs the prerelease version of the .NET tool package 'PowerShell' in the 'C:\tools' directory.
62+
# NOTE: When the version in the feed is for example v7.4.5-preview1 and the highest is v7.4.6, the highest will be installed.
6263
```

resources/Microsoft.DotNet.Dsc/Microsoft.DotNet.Dsc.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ $DotNetCliPath = Get-DotNetPath
336336
}
337337
338338
This example installs the prerelease version of the .NET tool package 'PowerShell' in the 'C:\tools' directory.
339+
NOTE: When the version in the feed is for example v7.4.5-preview1 and the highest is v7.4.6, the highest will be installed.
339340
#>
340341
[DSCResource()]
341342
class DotNetToolPackage {

resources/Microsoft.VSCode.Dsc/Microsoft.VSCode.Dsc.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ function Invoke-VSCode {
9595
[string]$Command
9696
)
9797

98-
$stdErrTempFile = "$env:TEMP\$((New-Guid).Guid)"
99-
$stdOutTempFile = "$env:TEMP\$((New-Guid).Guid)"
98+
$stdErrTempFile = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath (New-Guid).Guid
99+
$stdOutTempFile = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath (New-Guid).Guid
100100
$invocationSuccess = $true
101101

102102
$processParams = @{

tests/Microsoft.DotNet.Dsc/Microsoft.DotNet.Dsc.Tests.ps1

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,6 @@ Describe 'DSC operation capabilities' {
4343
$finalState.Version | Should -Not -BeNullOrEmpty
4444
}
4545

46-
It 'Sets desired package with prerelease' -Skip:(!$IsWindows) {
47-
$parameters = @{
48-
PackageId = 'dotnet-ef'
49-
PreRelease = $true
50-
}
51-
52-
Invoke-DscResource -Name DotNetToolPackage -ModuleName Microsoft.DotNet.Dsc -Method Set -Property $parameters
53-
54-
$finalState = Invoke-DscResource -Name DotNetToolPackage -ModuleName Microsoft.DotNet.Dsc -Method Get -Property $parameters
55-
$finalState.PackageId | Should -Be $parameters.PackageId
56-
$finalState.PreRelease | Should -BeTrue
57-
}
58-
5946
It 'Sets desired package with version' -Skip:(!$IsWindows) {
6047
$parameters = @{
6148
PackageId = 'dotnet-reportgenerator-globaltool'
@@ -99,7 +86,7 @@ Describe 'DSC operation capabilities' {
9986
It 'Exports resources' -Skip:(!$IsWindows) {
10087
$obj = [DotNetToolPackage]::Export()
10188

102-
$obj.PackageId.Contains('dotnet-ef') | Should -Be $true
89+
$obj.PackageId.Contains('gitversion.tool') | Should -Be $true
10390
$obj.PackageId.Contains('dotnet-reportgenerator-globaltool') | Should -Be $true
10491
}
10592

0 commit comments

Comments
 (0)