powershell

How to run EXE on VSTS Agent hosted machine

烈酒焚心 提交于 2020-12-13 05:36:42
问题 We have release pipeline in the VSTS that runs on a private server using VSTS agent. At the end of release pipeline there is a commmand line step to start executable (Nginx) file. Which succeeds but executable does not start the nginx process. I believe process dies as soon as the parent CMD or Powershell window dies. I have tried both CMD and Powershell (Start "exe" and Start-Process) to execute exe but none seem to be working. Those commands run perfectly on local computer but not when

How to run EXE on VSTS Agent hosted machine

ⅰ亾dé卋堺 提交于 2020-12-13 05:36:29
问题 We have release pipeline in the VSTS that runs on a private server using VSTS agent. At the end of release pipeline there is a commmand line step to start executable (Nginx) file. Which succeeds but executable does not start the nginx process. I believe process dies as soon as the parent CMD or Powershell window dies. I have tried both CMD and Powershell (Start "exe" and Start-Process) to execute exe but none seem to be working. Those commands run perfectly on local computer but not when

How to run EXE on VSTS Agent hosted machine

|▌冷眼眸甩不掉的悲伤 提交于 2020-12-13 05:35:44
问题 We have release pipeline in the VSTS that runs on a private server using VSTS agent. At the end of release pipeline there is a commmand line step to start executable (Nginx) file. Which succeeds but executable does not start the nginx process. I believe process dies as soon as the parent CMD or Powershell window dies. I have tried both CMD and Powershell (Start "exe" and Start-Process) to execute exe but none seem to be working. Those commands run perfectly on local computer but not when

PowerShell sorting problem of decimal numbers

冷暖自知 提交于 2020-12-13 04:25:26
问题 I have an array with decimal numbers like this: reihenfolge ########### 100000.00001 1000000.00001 101000.00001 101010.00001 101020.10001 If I sort it without parameters I get the order above. I would expect that the second number is the last entry. I also tried to sort as int or as version or with regex, but until now I didn't find the way I expect. $script:array = $script:array | Sort-Object reihenfolge $script:array = $script:array | Sort-Object { [regex]::Replace($_.reihenfolge, '\d+', {

How to read o:xml with powershell?

∥☆過路亽.° 提交于 2020-12-13 04:24:06
问题 I have following xml file but don't know how to read it with Powershell, Anyone can help with? Thanks! I need to get the url value from Powershell. <o:OfficeConfig xmlns:o="urn:xxx:xxx:xxx"> <o:services> <o:service o:name="xxxx"> <o:url>https://xxx.xxx</o:url> </o:service> </o:services> </o:OfficeConfig> Thanks in advance! 回答1: You can take advantage of the fact that PowerShell's convenient, property-based adaptation of the XML DOM essentially ignores namespaces, allowing to you simply drill

Passing the actual return code from Powershell

点点圈 提交于 2020-12-13 04:10:42
问题 I have a command-line exe utility that requires an inline password to call. Obviously, that's not ideal, so I've created a PS wrapper to encrypt the password and store it/call it from a PSCredential object. All of that is working fine, but I need error handling. If I add exit $LASTEXITCODE to the end of the script as I've seen suggested, I just get a simple 0 or 1. This utility uses return codes for scenarios that need to be handled differently, not all of which are actually errors. How can I

Passing the actual return code from Powershell

三世轮回 提交于 2020-12-13 04:09:32
问题 I have a command-line exe utility that requires an inline password to call. Obviously, that's not ideal, so I've created a PS wrapper to encrypt the password and store it/call it from a PSCredential object. All of that is working fine, but I need error handling. If I add exit $LASTEXITCODE to the end of the script as I've seen suggested, I just get a simple 0 or 1. This utility uses return codes for scenarios that need to be handled differently, not all of which are actually errors. How can I

Optimize Get-ADUser filter

爷,独闯天下 提交于 2020-12-13 03:40:32
问题 In AD, I'm trying to identify user accounts where the same EmployeeID value is populated in 2 or more records. Below is my piece of code (Credit: I'm using a Show-Progress function defined here) and the Get-ADUser command alone has taken more than 2 hours to fetch all the records. The other steps (2 to 5) have been pretty quick. While I've completed the work, I'm trying to know if this could've been done more efficiently with PowerShell. Get-ADUser -LDAPFilter "(&(ObjectCategory=Person)

Optimize Get-ADUser filter

最后都变了- 提交于 2020-12-13 03:39:50
问题 In AD, I'm trying to identify user accounts where the same EmployeeID value is populated in 2 or more records. Below is my piece of code (Credit: I'm using a Show-Progress function defined here) and the Get-ADUser command alone has taken more than 2 hours to fetch all the records. The other steps (2 to 5) have been pretty quick. While I've completed the work, I'm trying to know if this could've been done more efficiently with PowerShell. Get-ADUser -LDAPFilter "(&(ObjectCategory=Person)

Azure Logic App with SharePoint Connection

我只是一个虾纸丫 提交于 2020-12-13 03:07:57
问题 I am creating my first logic app which connects to SharePoint and adds entries into some sharepoint list. Whenever I create a SharePoint Connection it adds below resource to my logic app. { "type": "MICROSOFT.WEB/CONNECTIONS", "apiVersion": "2018-07-01-preview", "name": "[parameters('sharepointonline_1_Connection_Name')]", "location": "[parameters('logicAppLocation')]", "properties": { "api": { "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters(