Skip to content
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

Error in Version 4.4 #58

Open
sayeesrivenky opened this issue Sep 24, 2021 · 4 comments
Open

Error in Version 4.4 #58

sayeesrivenky opened this issue Sep 24, 2021 · 4 comments

Comments

@sayeesrivenky
Copy link

We are using version 4.4 and while deploying a non-top shelf service we get this error. Error does not occur in TopShelf Service though.
"The term '\Add-LocalUserToLogonAsAService.ps1' 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."

@Dejulia489
Copy link
Owner

Dejulia489 commented Sep 24, 2021 via email

@sayeesrivenky
Copy link
Author

powershell version in the target server is: 5.1.14393.4583

@plundber
Copy link

I have same/similar issue. PIpeline have been working fine and without changes to the pipeline it suddenly stopped working.

To troubleshoot I created a delops release with just this task keeps failing with errors:
2021-11-24T10:27:54.3361792Z ##[section]Starting: Deploy Windows Service
2021-11-24T10:27:54.3614189Z ==============================================================================
2021-11-24T10:27:54.3614744Z Task : Windows Service Manager
2021-11-24T10:27:54.3615150Z Description : Deploys a Windows Service to an Agent or a Deployment Group Target using WinRM.
2021-11-24T10:27:54.3615397Z Version : 4.5.0
2021-11-24T10:27:54.3615692Z Author : MDSolutions
2021-11-24T10:27:54.3616148Z Help : More Information
2021-11-24T10:27:54.3616464Z ==============================================================================
2021-11-24T10:27:54.6980223Z . : The term 'C:\azagent\A2_work_tasks\WindowsServiceManager_7dad075d-a817-45ac-baab-4c1376d2885e\4.5.0\ps_modules\Vs
2021-11-24T10:27:54.6981130Z tsTaskSdk\FindFunctions.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program.
2021-11-24T10:27:54.6981500Z Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
2021-11-24T10:27:54.6982112Z At C:\azagent\A2_work_tasks\WindowsServiceManager_7dad075d-a817-45ac-baab-4c1376d2885e\4.5.0\ps_modules\VstsTaskSdk\V
2021-11-24T10:27:54.6982403Z stsTaskSdk.psm1:23 char:3
2021-11-24T10:27:54.6982576Z + . "$PSScriptRoot\FindFunctions.ps1"
2021-11-24T10:27:54.6982777Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-11-24T10:27:54.6983188Z + CategoryInfo : ObjectNotFound: (C:\azagent\A2_...ndFunctions.ps1:String) [], CommandNotFoundException
2021-11-24T10:27:54.6983549Z + FullyQualifiedErrorId : CommandNotFoundException
2021-11-24T10:27:54.6983713Z
2021-11-24T10:27:54.7051280Z . : The term 'C:\azagent\A2_work_tasks\WindowsServiceManager_7dad075d-a817-45ac-baab-4c1376d2885e\4.5.0\ps_modules\Vs
2021-11-24T10:27:54.7051748Z tsTaskSdk\InputFunctions.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program.
2021-11-24T10:27:54.7052154Z Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
2021-11-24T10:27:54.7052713Z At C:\azagent\A2_work_tasks\WindowsServiceManager_7dad075d-a817-45ac-baab-4c1376d2885e\4.5.0\ps_modules\VstsTaskSdk\V
2021-11-24T10:27:54.7053132Z stsTaskSdk.psm1:24 char:3
2021-11-24T10:27:54.7053312Z + . "$PSScriptRoot\InputFunctions.ps1"
2021-11-24T10:27:54.7053493Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-11-24T10:27:54.7053805Z + CategoryInfo : ObjectNotFound: (C:\azagent\A2_...utFunctions.ps1:String) [], CommandNotFoundException
2021-11-24T10:27:54.7054171Z + FullyQualifiedErrorId : CommandNotFoundException

...

2021-11-24T10:27:54.8139381Z Out-Default : The term 'global:Out-Default' is not recognized as the name of a cmdlet, function, script file, or
2021-11-24T10:27:54.8139869Z operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
2021-11-24T10:27:54.8140112Z again.
2021-11-24T10:27:54.8140358Z At C:\azagent\A2_work_tasks\WindowsServiceManager_7dad075d-a817-45ac-baab-4c1376d2885e\4.5.0\ps_modules\VstsTaskSdk\V
2021-11-24T10:27:54.8140641Z stsTaskSdk.psm1:117 char:62
2021-11-24T10:27:54.8140892Z + ... [scriptblock]::Create($scriptText)) 2>&1 3>&1 4>&1 5>&1 | Out-Default
2021-11-24T10:27:54.8141183Z + ~~~~~~~~~~~
2021-11-24T10:27:54.8141504Z + CategoryInfo : ObjectNotFound: (global:Out-Default:String) [], CommandNotFoundException
2021-11-24T10:27:54.8141844Z + FullyQualifiedErrorId : CommandNotFoundException
2021-11-24T10:27:54.8142009Z
2021-11-24T10:27:54.8388020Z The term 'global:Out-Default' 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.
2021-11-24T10:27:54.8388735Z At line:1 char:929
2021-11-24T10:27:54.8388985Z + ... Continue' ; Invoke-VstsTaskScript -ScriptBlock ([scriptblock]::Create ...
2021-11-24T10:27:54.8389297Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-11-24T10:27:54.8732268Z ##[error]Exit code 1 returned from process: file name 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe', arguments '-NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". ([scriptblock]::Create('if ([Console]::InputEncoding -is [Text.UTF8Encoding] -and [Console]::InputEncoding.GetPreamble().Length -ne 0) { [Console]::InputEncoding = New-Object Text.UTF8Encoding $false } if (!$PSHOME) { $null = Get-Item -LiteralPath ''variable:PSHOME'' } else { Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1'')) ; Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1'')) }')) 2>&1 | ForEach-Object { Write-Verbose $_.Exception.Message -Verbose } ; Import-Module -Name 'C:\azagent\A2_work_tasks\WindowsServiceManager_7dad075d-a817-45ac-baab-4c1376d2885e\4.5.0\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1' -ArgumentList @{ NonInteractive = $true } -ErrorAction Stop ; $VerbosePreference = 'SilentlyContinue' ; $DebugPreference = 'SilentlyContinue' ; Invoke-VstsTaskScript -ScriptBlock ([scriptblock]::Create('. ''C:\azagent\A2_work_tasks\WindowsServiceManager_7dad075d-a817-45ac-baab-4c1376d2885e\4.5.0\DeployWindowsService.ps1'''))"'.
2021-11-24T10:27:54.8746693Z ##[section]Finishing: Deploy Windows Service

Windows server 2016, powershell version 5.1.14393.1066

@plundber
Copy link

Hi again.
Removing the target machine from the deployment group and re-registering it solved it for me. Sorry for reporting before trying "everything"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants