I’m attempting to install and configure Powershell Web Access on a Windows Server. I’ve gotten the feature installed and I’m now trying to setup the web access gateway using the DSC Script resource.
This is the code I’m using. When the web application is not there, I can manually run Install-PswaWebApplication and it does not prompt. However, when I run this DSC resource, I’m getting the error below.
Script PsaWebAccessGateway {
SetScript = {
Install-PswaWebApplication
}
TestScript = {
[bool](Get-WebApplication -Name pswa | where {$_.ApplicationPool -eq 'pswa_pool'}) -eq $true
}
GetScript = {
$result = [bool](Get-WebApplication -Name pswa | where {$_.ApplicationPool -eq 'pswa_pool'})
return @{HasPsaWebAccessGatewayInstalled = $result}
}
}
This is the error I’m getting:
PowerShell provider MSFT_ScriptResource failed to execute Set-TargetResource functionality with error message: A command that prompts the user failed because the host program or the command type does not support user interaction. Try a host program that
supports user interaction, such as the Windows PowerShell Console or Windows PowerShell ISE, and remove prompt-related commands from command types that do not support user interaction, such as Windows PowerShell workflows.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost