powershell

Update JSON file using PowerShell

心已入冬 提交于 2020-12-02 05:54:02
问题 I am currently trying to setup a continuous integration system using VSTS and have run into a bit of a snag. As part of the release process I need to update a specific object value in a JSON file depending on the environment. The only tools it seems I have at my disposal that might get this done in the VSTS environment is PowerShell. I've done quite a bit of research and have not been able to figure out how exactly this can be done. I found this question and answer here on Stack Overflow "How

Update JSON file using PowerShell

橙三吉。 提交于 2020-12-02 05:52:52
问题 I am currently trying to setup a continuous integration system using VSTS and have run into a bit of a snag. As part of the release process I need to update a specific object value in a JSON file depending on the environment. The only tools it seems I have at my disposal that might get this done in the VSTS environment is PowerShell. I've done quite a bit of research and have not been able to figure out how exactly this can be done. I found this question and answer here on Stack Overflow "How

Azure DevOps audit logs download rest api not downloading filtered data for given months

我是研究僧i 提交于 2020-12-01 18:03:54
问题 Hi I am not able able to download data for mentioned duration , It downloads all the logs. $outfile = "/logs.csv" $connectionToken="" $base64AuthInfo= [System.Convert]::ToBase64String([System.Text.Encoding]:: ASCII.GetBytes(":$($connectionToken)")) $AuditLogURL = "https://auditservice.dev.azure.com/{og_name}/_apis/audit/downloadlog? format=csv&startTime=2020-09-04T00.00.00&endTime=2020-10-05T00.00.00&api-version=6.1- preview.1" $AuditInfo = Invoke-RestMethod -Uri $AuditLogURL -Headers @

Azure DevOps audit logs download rest api not downloading filtered data for given months

耗尽温柔 提交于 2020-12-01 17:35:40
问题 Hi I am not able able to download data for mentioned duration , It downloads all the logs. $outfile = "/logs.csv" $connectionToken="" $base64AuthInfo= [System.Convert]::ToBase64String([System.Text.Encoding]:: ASCII.GetBytes(":$($connectionToken)")) $AuditLogURL = "https://auditservice.dev.azure.com/{og_name}/_apis/audit/downloadlog? format=csv&startTime=2020-09-04T00.00.00&endTime=2020-10-05T00.00.00&api-version=6.1- preview.1" $AuditInfo = Invoke-RestMethod -Uri $AuditLogURL -Headers @

PowerShell : retrieve file from GitHub

孤街醉人 提交于 2020-12-01 12:57:14
问题 I need to download a file from my GitHub private repo. So following the instructions on the GitHub site, I created an OAuth token for my credentials. Then I executed this PS script : $WebClient = New-Object -TypeName System.Net.WebClient $WebClient.Headers.Add('Authorization','{OAuth token}') $uri = "https://github.com/mycompany/myrepo/blob/master/myfile.zip" $targetPath = "c:\temp" $WebClient.DownloadFile($uri, $targetPath) However, $WebClient.DownloadFile() returns a 404. This is strange

PowerShell : retrieve file from GitHub

拟墨画扇 提交于 2020-12-01 12:52:21
问题 I need to download a file from my GitHub private repo. So following the instructions on the GitHub site, I created an OAuth token for my credentials. Then I executed this PS script : $WebClient = New-Object -TypeName System.Net.WebClient $WebClient.Headers.Add('Authorization','{OAuth token}') $uri = "https://github.com/mycompany/myrepo/blob/master/myfile.zip" $targetPath = "c:\temp" $WebClient.DownloadFile($uri, $targetPath) However, $WebClient.DownloadFile() returns a 404. This is strange

win10系统如何安装微软应用商店?

[亡魂溺海] 提交于 2020-12-01 12:30:39
在win10系统左下角的图标中,找到 搜索符号 并点击。 我们在搜索栏中输入“ PowerShell ”进行搜索。 然后在右侧选项栏中,选择“ 以管理员身份运行 ”,进入调试页面。 在代码录入页面输入“ Get-AppxPackage -allusers | Select Name, PackageFullName ”,这样就看到了win10系统初始自带的一些程序。 在列表中我们找到“ Microsoft.WindowsStore ”微软应用商店,复制后面的安装包位置进剪切板“ Microsoft.WindowsStore_11905.1001.4.0_x64__8wekyb3d8bbwe ”。 然后继续在代码录入页面录【Add-appxpackage -register "C:\Program Files\WindowsApps\ Microsoft.WindowsStore_11905.1001.4.0_x64__8wekyb3d8bbwe (黑色部分为第五步中安装包位置)\appxmanifest.xml" -disabledevelopmentmod】,然后按 回车键 确认。 然后系统会提示正在部署操作进程,我们返回到程序界面,就可以看到微软应用程序已经安装好了。 来源: oschina 链接: https://my.oschina.net/raferowe/blog

What is the equivalent of 'nohup' in PowerShell?

好久不见. 提交于 2020-12-01 11:06:45
问题 How can I emulate the behavior of the unix command nohup in PowerShell? That is nohup my-other-nonblocking-command . I have noticed the Start-Job command, however the syntax is somewhat unclear to me. 回答1: > Start-Job my.exe Fails with this output: Start-Job : Parameter set cannot be resolved using the specified named parameters. At line:1 char:1 + Start-Job my.exe + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Start-Job], ParameterBindingException +

What is the equivalent of 'nohup' in PowerShell?

梦想与她 提交于 2020-12-01 11:06:40
问题 How can I emulate the behavior of the unix command nohup in PowerShell? That is nohup my-other-nonblocking-command . I have noticed the Start-Job command, however the syntax is somewhat unclear to me. 回答1: > Start-Job my.exe Fails with this output: Start-Job : Parameter set cannot be resolved using the specified named parameters. At line:1 char:1 + Start-Job my.exe + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Start-Job], ParameterBindingException +

Change DataSource of SSRS Report with Powershell

末鹿安然 提交于 2020-12-01 09:52:45
问题 I'm trying to ahange data sources of multiple SSRS Report with Powershell to one shared data source on my reporting server. Here my code: cls; $reportserver = "myServer";<br/> $url = "http://$($reportserver)/reportserver/reportservice2005.asmx?WSDL";";<br/> $ssrs = New-WebServiceProxy -uri $url -UseDefaultCredential -Namespace "ReportingWebService"; [ReportingWebService.DataSource[]] $myDataSource = new-object ReportingWebService.DataSource $myDataSource[0].Name = "myDS"";<br/> $myDataSource