I want to publish a .NET core application to Elastic Beanstalk and they will be running on Windows Server. I want to make some changes to IIS settings... more precisely Queue Length of Application Pool.
I have aws-windows-deployment-manifest.json file with the following content
{
"manifestVersion": 1,
"deployments": {
"aspNetCoreWeb": [
{
"name": "my-dotnet-core-app",
"scripts": {
"postInstall": {
"file": "SetupScripts/setupAppPool.ps1"
}
}
}
]
}
}
Inside setupAppPool.ps1 script is the following content:
Import-Module WebAdministration
$defaultAppPool = Get-ItemProperty IIS:\AppPools\DefaultAppPool
#$defaultAppPool.PSPath
Write-Host "Display Queue Length before change: " -NoNewline
(Get-ItemProperty IIS:\AppPools\DefaultAppPool\).queueLength
#Value changed here
Set-ItemProperty -Path $defaultAppPool.PSPath -Name queueLength -Value 3000
Write-Host "Display Queue Length after change: " -NoNewline
(Get-ItemProperty IIS:\AppPools\DefaultAppPool\).queueLength
If it will be a simple scritp like hostname it executes with no problem, however this one fails with the following error:
2022-07-12 17:41:25,025 [INFO] Running config InfoTask-TailLogs
AWS.DeploymentCommands.2022.07.12-17.40.30.log:
Starting deployment for my-dotnet-core-app of type AspNetCoreWeb
Parameters:
appBundle: .
iisPath: /
iisWebSite: Default Web Site
Starting restart of my-dotnet-core-app
---------- Executing command "C:\Windows\system32\iisreset.exe /restart" ----------
---------- CWD "" ----------
Attempting stop...
Internet services successfully stopped
Attempting start...
Internet services successfully restarted
---------- Command complete with exit code 0 ----------
Starting ASP.NET Core web deployment my-dotnet-core-app at C:\inetpub\AspNetCoreWebApps\my-dotnet-core-app with IIS path Default Web Site/
Copying C:\staging\. to C:\inetpub\AspNetCoreWebApps\my-dotnet-core-app
Removing existing application from IIS
Adding application to IIS
Commit changes to IIS
---------- Executing command "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy unrestricted -NonInteractive -NoProfile -Command "& { & \"C:\staging\SetupScripts/setupAppPool.ps1\"; exit $LastExitCode }" " ----------
---------- CWD "C:\inetpub\AspNetCoreWebApps\my-dotnet-core-app" ----------
Get-ItemProperty : Cannot retrieve the dynamic parameters for the cmdlet. Retrieving the COM class factory for
component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not
registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At C:\staging\SetupScripts\setupAppPool.ps1:2 char:19
+ $defaultAppPool = Get-ItemProperty IIS:\AppPools\DefaultAppPool
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-ItemProperty], ParameterBindingException
+ FullyQualifiedErrorId : GetDynamicParametersException,Microsoft.PowerShell.Commands.GetItemPropertyCommand
Get-ItemProperty : Cannot retrieve the dynamic parameters for the cmdlet. Retrieving the COM class factory for
component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not
registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At C:\staging\SetupScripts\setupAppPool.ps1:7 char:2
+ (Get-ItemProperty IIS:\AppPools\DefaultAppPool\).queueLength
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-ItemProperty], ParameterBindingException
+ FullyQualifiedErrorId : GetDynamicParametersException,Microsoft.PowerShell.Commands.GetItemPropertyCommand
Set-ItemProperty : Cannot bind argument to parameter 'Path' because it is null.
At C:\staging\SetupScripts\setupAppPool.ps1:10 char:24
+ Set-ItemProperty -Path $defaultAppPool.PSPath -Name queueLength -Valu ...
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Set-ItemProperty], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SetItemProp
ertyCommand
Get-ItemProperty : Cannot retrieve the dynamic parameters for the cmdlet. Retrieving the COM class factory for
component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not
registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At C:\staging\SetupScripts\setupAppPool.ps1:13 char:2
+ (Get-ItemProperty IIS:\AppPools\DefaultAppPool\).queueLength
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-ItemProperty], ParameterBindingException
+ FullyQualifiedErrorId : GetDynamicParametersException,Microsoft.PowerShell.Commands.GetItemPropertyCommand
Display Queue Length before change: Display Queue Length after change:
---------- Command complete with exit code 0 ----------
Error messages running the command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy unrestricted -NonInteractive -NoProfile -Command "& { & \"C:\staging\SetupScripts/setupAppPool.ps1\"; exit $LastExitCode }"
Get-ItemProperty : Cannot retrieve the dynamic parameters for the cmdlet. Retrieving the COM class factory for
component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not
registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At C:\staging\SetupScripts\setupAppPool.ps1:2 char:19
+ $defaultAppPool = Get-ItemProperty IIS:\AppPools\DefaultAppPool
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-ItemProperty], ParameterBindingException
+ FullyQualifiedErrorId : GetDynamicParametersException,Microsoft.PowerShell.Commands.GetItemPropertyCommand
Get-ItemProperty : Cannot retrieve the dynamic parameters for the cmdlet. Retrieving the COM class factory for
component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not
registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At C:\staging\SetupScripts\setupAppPool.ps1:7 char:2
+ (Get-ItemProperty IIS:\AppPools\DefaultAppPool\).queueLength
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-ItemProperty], ParameterBindingException
+ FullyQualifiedErrorId : GetDynamicParametersException,Microsoft.PowerShell.Commands.GetItemPropertyCommand
Set-ItemProperty : Cannot bind argument to parameter 'Path' because it is null.
At C:\staging\SetupScripts\setupAppPool.ps1:10 char:24
+ Set-ItemProperty -Path $defaultAppPool.PSPath -Name queueLength -Valu ...
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Set-ItemProperty], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SetItemProp
ertyCommand
Get-ItemProperty : Cannot retrieve the dynamic parameters for the cmdlet. Retrieving the COM class factory for
component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not
registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At C:\staging\SetupScripts\setupAppPool.ps1:13 char:2
+ (Get-ItemProperty IIS:\AppPools\DefaultAppPool\).queueLength
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-ItemProperty], ParameterBindingException
+ FullyQualifiedErrorId : GetDynamicParametersException,Microsoft.PowerShell.Commands.GetItemPropertyCommand
---------- Executing command "C:\Windows\system32\iisreset.exe /start" ----------
---------- CWD "" ----------
Attempting start...
Internet services successfully started
---------- Command complete with exit code 0 ----------
AWSCommandWrapper.log:
How can I solve this problem?
Related
I want to build this open source project from source for contributing. I am following this docs for windows. I cloned the repo and install chocolatey as mention. Then I am executing the commands in "prepare the enviorment section" . I was able to run 1st command correctly
PS A:\wasmedgebuild\WasmEdge> choco install cmake ninja vswhere
But when I run second one .
PS A:\wasmedgebuild\WasmEdge> $vsPath = (vswhere -latest -property
installationPath) Import-Module (Join-Path $vsPath
"Common7\Tools\Microsoft.VisualStudio.DevShell.dll") Enter-VsDevShell
-VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.19041.0"
I am getting this error:
Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At line:2 char:26
+ Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudi ...
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Enter-VsDevShell : The term 'Enter-VsDevShell' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:3 char:1
+ Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCm ...
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Enter-VsDevShell:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Screenshot
I don't know what is the problem. Am I doing it in wrong way?
While Executing the c++ code on VS through command terminal, getting below error. Coupld you please comment on this.
PS D:\Test> .\a.exe
Program 'a.exe' failed to run: The system cannot find the file specifiedAt line:1 char:1
+ .\a.exe
+ ~~~~~~~.
At line:1 char:1
+ .\a.exe
+ ~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
PS D:\Test>
I'm trying to create a provisioned product in service catalog by using PowerShell.
cmdlet $newProduct = New-SCProvisionedProduct -ProvisionedProductName $product_name -ProductId $product_id
-ProvisioningArtifactId $artifact_id -ProvisioningParameter #( #{key="Server_size";value="$server.serversize"},{key= "Key_pair",value="demo_key"} )
But I don't know how to pass multiple values in provisioning parameter it showing some error
New-SCProvisionedProduct : Cannot bind parameter 'ProvisioningParameter'.
Cannot convert the "[" value of type "System.String" to type
"Amazon.ServiceCatalog.Model.ProvisioningParameter".
At line:1 char:162
+ ... -ProvisioningArtifactId $artifact_id -ProvisioningParameter [ {key="S ...
+ ~
+ CategoryInfo : InvalidArgument: (:) [New-SCProvisionedProduct],
ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Amazon.PowerShell
.Cmdlets.SC.NewSCProvisionedProductCmdlet
Could anyone help me with the AWS Powershell command to pass multiple values in provisioning parameter (or) help to sort this error
I'm running the below command to connect to vCloud Director using PowerShell
Connect-CIServer -Server "company.com.au" -User "username" -Password "password" -Org "testorg"
However, it is giving me error like below:
Connect-CIServer : 20/09/2019 2:13:12 PM Connect-CIServer
Unable to connect to vCloud Server 'https://company.com.au:443/api/'. The
server returned the following: Unauthorized: ''.
At line:1 char:1
+ Connect-CIServer -Server "company.com.au" -User "username" -Pas ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-CIServer], CIException
+ FullyQualifiedErrorId : Cloud_ConnectivityServiceImpl_ConnectCloudServer_ConnectError,VMware.VimAutomation.Cloud.Commands.Cmdlets.ConnectCIServer
Unfortunately, not much information is given, I can login to the UI by the same credentials but not on command line?
I had similar issue when I was trying to login to VCentre, I got it working by ignoring certificates. Not sure if for VCloud Server,I am facing same issue?
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
Works well when I drop -Org parameter! so the command which worked for me to login to Cloud Director is as below:
Connect-CIServer -Server "company.com.au" -User "username" -Password "password"
I'm executing the following:
Set-AzureRmVMExtension `
-VMName 'servername' `
-ResourceGroupName 'rgname' `
-Name 'JoinAD' `
-ExtensionType 'JsonADDomainExtension' `
-Publisher 'Microsoft.Compute' `
-TypeHandlerVersion '1.0' `
-Location 'West Europe' `
-Settings #{'Name' = 'domain.com'; 'OUPath' = 'OU=Server 2012 R2,OU=Servers,DC=domain,DC=com'; 'User' = 'domain.com\username'; 'Restart' = 'true'; 'Options' = 3} `
-ProtectedSettings #{'Password' = 'password'}
and get this error:
Set-AzureRmVMExtension : Long running operation failed with status
'Failed'. StartTime: 18.04.2016 18:03:30 EndTime: 18.04.2016 18:04:50
OperationID: 76825458-6c50-404d-bb1a-b27c722b1760 Status: Failed
ErrorCode: VMExtensionProvisioningError ErrorMessage: VM has reported
a failure when processing extension 'JoinAD'. Error message: "Join
completed for Domain 'ddomain.com'". At line:1 char:1
+ Set-AzureRmVMExtension `
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureRmVMExtension], ComputeCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.SetAzureVMExtensionCommand
What am I missing?
Kept having trouble with extension, therefore opted to perform the domain join using PowerShell Add-Computer without extensions.
One possibly cause might be that NSG configurations block connectivity to the internet and with that to services running in the Azure data center.