-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when calling Grani_DotNetFramework #80
Comments
Thank you for the report. Yeah, it seems some issue goes on. Let me check. |
Caused by VSCode Formatter and I did not run test. will be fix in 3.7.9.1. |
Fixed. function VerifyInstallation {
[OutputType([Void])]
[CmdletBinding()]
param
(
[parameter(Mandatory = $true)]
[System.String]$KB,
[parameter(Mandatory = $true)]
[System.String]$Ensure
)
$result = (Get-HotFix | where HotFixId -eq $KB | measure).Count
if ($Ensure -eq [EnsureType]::Absent.ToString()) {
# Absent
# should be 0 for success uninstallation
if ($result -ne 0) {
throw New-Object System.ArgumentException ($ErrorMessages.VerifyInstallationKBFound -f $KB);
}
Write-Verbose ($VerboseMessages.CompleteUninstallation -f $KB);
}
elseif ($Ensure -eq [EnsureType]::Present.ToString()) {
# Present
# should be 1 for success installation
if ($result -eq 0) {
throw New-Object System.NullReferenceException ($ErrorMessages.VerifyInstallationKBNotFound -f $KB);
}
Write-Verbose ($VerboseMessages.CompleteInstallation -f $KB);
}
} |
@baannee Many thank you for report. I've fixed issue and publish hotfix 3.7.9.1. Would you mind confirm it works on your environment?
Install-Module -Name GraniResource |
Hi,
After reboot, it shows that .NET 4.7.1 is installed. |
@guitarrapc - I have having the same issue as @baannee on Windows 2012 Server R2. I have also tried with .NET 4.6.2 and .NET 4.7 Here's the verbose output
Also, this has worked fine in the past. Maybe a recent Windows Update has caused a change in behavior? |
First of all, thank you for using this resource and verbose situation. I was not using the resource currently so that I need to setup VM for Win2012 R2 to fix this issue. Let me check it. I will check with latest windows update applied instance. |
Log and actual behavior shows installation is finished.
So that issue would be it can't detect KB installed without a reboot.
|
@guitarrapc - thanks for the prompt response. Using this article, I was able to determine that my system actually had 4.7.1 already installed (maybe from a Windows update). So, I suppose this would be expected behavior when using your resource to install 4.6.2? |
thanks. the article is what I refer when created this resource. I will review again. |
I guess the question is, what should happen if a higher version of the framework is already installed? Since they are in-place updates, maybe the Test should return that it is already in the desired state? Like, when you are trying to install 4.6.2, but 4.7.1 is already there? |
Correct. |
After installing module on both, Windows 10 and Server 2016, I am getting:
PowerShell DSC resource MSFT_PackageResource failed to execute Set-TargetResource functionality
with error message: The running command stopped because the
preference variable "ErrorActionPreference" or common parameter is set to Stop: Access is denied
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : localhostImporting module Grani_DotNetFramework failed with error -At
C:\Program
Files\WindowsPowerShell\Modules\GraniResource\3.7.9.0\DscResources\Grani_DotNetFramework\Grani
_DotNetFramework.psm1:408 char:26_DotNetFramework.psm1:413 char:55
+ elseif ($Ensure -eq [EnsureType]::Present.ToString()) {
+ ~
Unexpected token '{' in expression or statement.
At C:\Program
Files\WindowsPowerShell\Modules\GraniResource\3.7.9.0\DscResources\Grani_DotNetFramework\Grani
_DotNetFramework.psm1:415 char:22_DotNetFramework.psm1:419 char:1
+ }
+ ~
Unexpected token '}' in expression or statement.
At C:\Program
Files\WindowsPowerShell\Modules\GraniResource\3.7.9.0\DscResources\Grani_DotNetFramework\Grani
_DotNetFramework.psm1:420 char:1By the error message, and I am not sure why this is an issue, "{ }" making trouble. When I reorganize them, all is working as expected.
https://app.leanboard.io/board/705af88f-a126-4b24-aa44-cefb02689ee7
The text was updated successfully, but these errors were encountered: