powershell

Powershell to download ARM template for Azure data factory Pipeline

℡╲_俬逩灬. 提交于 2021-02-10 17:27:41
问题 i have a requirement to create an ADF pipeline using ARM template in powershell and it has to take inputs/validate few things from existing ADF piepline, for that reason i have to download the ARM tempalte for existing ADF pipeline through powershell. Can we do that for single ADF pipeline or multiple ones? Note: existing pipeline is not created through ARM deployment, so i cant use "Save-AzureRmDeploymentTemplate" as i dont have deployment name created when pipeline is created through portal

Powershell to download ARM template for Azure data factory Pipeline

此生再无相见时 提交于 2021-02-10 17:26:00
问题 i have a requirement to create an ADF pipeline using ARM template in powershell and it has to take inputs/validate few things from existing ADF piepline, for that reason i have to download the ARM tempalte for existing ADF pipeline through powershell. Can we do that for single ADF pipeline or multiple ones? Note: existing pipeline is not created through ARM deployment, so i cant use "Save-AzureRmDeploymentTemplate" as i dont have deployment name created when pipeline is created through portal

How do I POST from Powershell using Invoke-RestMethod

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-10 16:56:13
问题 As per https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7#example-2--run-a-post-request I am trying to invoke a simple POST method but getting some errors. My instruction is: $uri = "https://localhost:44355/api/job/machine-status"; #$machineName = HOSTNAME.EXE; $machineName = "simPass2"; $body = @{ Name = $machineName Status = "Complete" } Invoke-RestMethod -Method 'Post' -Uri $uri -ContentType 'application/json' -Body $body;

Accessing an azure vm through Powershell remote from Azure Automation

丶灬走出姿态 提交于 2021-02-10 16:00:46
问题 I am trying to access an azure vm via powershell remoting from azure automation. All our vms inside the subscription do not have public ips (only private ip). I have tried to access by New-Pssession (as below) , but no luck. Could you please let me know what are the other ways to achive this? $connectionName = "AzureRunAsConnection" $SPC = Get-AutomationConnection -Name $connectionName Write-Output $SPC Add-AzureRmAccount -ServicePrincipal -TenantId $SPC.TenantId -ApplicationId $SPC

PowerShell SendKeys to InternetExplorer ComObject

纵然是瞬间 提交于 2021-02-10 15:56:47
问题 Here's one method I found which brings the IE ComObject window to the foreground and uses SendKeys. How would I send a sequence of key presses using this method? $ie = New-Object -ComObject InternetExplorer.Application $ie.navigate("www.google.com") do {sleep 1} until (-not ($ie.Busy)) Add-Type -AssemblyName System.Windows.Forms Add-Type @" using System; using System.Runtime.InteropServices; public class StartActivateProgramClass { [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType

Delete Files in subfolders after encode

时间秒杀一切 提交于 2021-02-10 15:48:25
问题 I want to delete files in my subfolders with a PowerShell script. I already tried using Remove-Item in PowerShell, but failed to set it up correctly... This is the code I use for encoding: Get-ChildItem *.mkv | where BaseName -notlike '*`[HEVC]' | foreach { ffmpeg -i $_ -c:v libx265 -c:a copy -x265-params crf=25 "$($_.BaseName) [HEVC].mkv" -n } I want to either include Remove-Item [source file] in this script to delete the source files by checking the name of the file. How would I do that?

“Publish” programmatically on Azure Data Factory through powershell or Azure Devops pipeline step

假如想象 提交于 2021-02-10 15:40:15
问题 This question won't have any code because I haven't found any possible way so far but not even a straight no, it's not possible . Azure Data Factory uses adf_publish branch as the official branch on top of the master. ADF publishes the definitions of all the pipelines, triggers, linked services, etc to this adf_publish branch when on the GUI the user clicks on Publish . I need to do this programmatically. I don't want someone to go on the ADF portal itself and click on the Publish button so

“Publish” programmatically on Azure Data Factory through powershell or Azure Devops pipeline step

吃可爱长大的小学妹 提交于 2021-02-10 15:38:36
问题 This question won't have any code because I haven't found any possible way so far but not even a straight no, it's not possible . Azure Data Factory uses adf_publish branch as the official branch on top of the master. ADF publishes the definitions of all the pipelines, triggers, linked services, etc to this adf_publish branch when on the GUI the user clicks on Publish . I need to do this programmatically. I don't want someone to go on the ADF portal itself and click on the Publish button so

Powershell: Searching for file a extension in XML nodes and deleting the parent nodes

久未见 提交于 2021-02-10 15:38:26
问题 I am using powershell to do some clean up of retro pi game lists but am stuck with the syntax for working with xml. The goal is to remove all game entries for a particular file extension type. The list is formatted as so: <?xml version="1.0"?> <gameList> <game id="" source=""> <path>./2020 Super Baseball (USA).SMC</path> <name>2020 Super Baseball</name> <desc /> <image>./boxart/2020 Super Baseball (USA).png</image> <marquee>./wheel/2020 Super Baseball (USA).png</marquee> <video>./snap/2020

“Publish” programmatically on Azure Data Factory through powershell or Azure Devops pipeline step

岁酱吖の 提交于 2021-02-10 15:37:34
问题 This question won't have any code because I haven't found any possible way so far but not even a straight no, it's not possible . Azure Data Factory uses adf_publish branch as the official branch on top of the master. ADF publishes the definitions of all the pipelines, triggers, linked services, etc to this adf_publish branch when on the GUI the user clicks on Publish . I need to do this programmatically. I don't want someone to go on the ADF portal itself and click on the Publish button so