All Questions
Tagged with powershell azure-powershell
1,397 questions
0
votes
1
answer
45
views
Generating SAS account token in powershell
"I generated a token using Azure and it’s working, but I need to create a correct script in PowerShell using the key. The stringToSign I generated is different from the one provided by Azure, and ...
1
vote
0
answers
20
views
PowerShell "Assembly with same name is already loaded" on different Module Versions [duplicate]
I have a script that requires using two versions of the same module with conflicting assemblies:
#Requires -PSEdition Core
# main logic
Install-Module -Name MyModule -RequiredVersion 2 -Scope ...
0
votes
2
answers
28
views
Powershell how to use azure vault secret value using yaml
I am new to yaml file, I am facing issues.
error : "The term 'devkey' is not recognized as a name of a cmdlet, function, script file, or operable program."
I have variable group called ...
0
votes
2
answers
49
views
Better way to deal with multiple foreach loops in Powershell?
Is there a better way in Powershell to handle multiple levels of returned values than nested foreach loops?
I need to get a list of each of our Azure Virtual Desktop session hosts for further ...
0
votes
1
answer
61
views
Azure VM, extension script in powershell, how to pass as a parameter json object
I have a script in Powershell, I would like to run it as a script extension in Azure VM. The script is supposed to download various things, and the configuration would enter it as an object. I've been ...
0
votes
1
answer
66
views
Azure PowerShell command to list all Azure VM SKU Sizes enabled for Confidential Computing Azure ACC
Get-AzVMSize -Location "West US"
The command above returns a list of all Azure VM SKU sizes in this format.
Name NumberOfCores MemoryInMB MaxDataDiskCount ...
0
votes
1
answer
75
views
Query resources in resource groups where tags are missing
I have got Azure resources within specific resource groups, however I do need to ensure that all resources have the following tags.
Environment
Cost_centre
Department
Owner
Type
So far it has ...
2
votes
1
answer
79
views
Powershell 5 vs 7 different output [duplicate]
I have a strange case running something in Powershell 7 returns the expected result, but in Powershell 5 it doesn't unless you break op the line in multiple assignments
Does anybody have an idea what ...
0
votes
1
answer
113
views
Azure PowerShell: 404 Not Found when calling Microsoft.DomainRegistration/generateSsoRequest
I'm attempting to set up Cloudflare to host Azure domain names, following the process outlined in a Microsoft Q&A article.
As part of this process, I need to generate an SSO request for Azure ...
0
votes
1
answer
77
views
Create Alert rule using New-AzScheduledQueryRuleConditionObject returns bad term
I'm trying to create a new Alert rule dynamically using DevOps pipelines and Powershell, but it's been really frustrating since documentation states some parameters are available to be passed in, but ...
0
votes
1
answer
149
views
How to mock New-AzStorageContext in Pester
I would like to mock New-AzStorageContext to return a value that can be used as the DestContext parameter of the function Start-AzStorageBlobCopy.
I have tried New-MockObject of Microsoft.WindowsAzure....
0
votes
1
answer
279
views
How to get Drive Item ID of a file from a user OneDrive using PowerShell Microsoft Graph
I'm trying to get a specific file's Drive Item ID from a user's OneDrive using Microsoft Graph. The sample script below is working, but it's really slow because it has to search the entire user's ...
0
votes
1
answer
78
views
Creating new azure web app with New-AzWebApp based on container image
My goal is to achieve something with powershell to automate the creation of an azure web app from powershell.
New-AzWebApp -ResourceGroupName $ResourceGroupName -Name $WebAppName -Location 'West ...
0
votes
1
answer
82
views
Invoke-AzAksRunCommand how to run aks-command pod with toleration
I'm trying to run:
Invoke-AzAksRunCommand -ResourceGroupName myrg -Name mycluster -Command "kubectl delete pod --all -n myns;"
but the temporary pod that Invoke-AzAksRunCommand will create ...
1
vote
1
answer
71
views
Update ADF trigger time for week days (Monday to Saturday) using azure PowerShell script
I wrote the following PowerShell script, but encountered an issue while setting weekdays from Monday to Saturday. The error I received was:
##[error]Exception setting "WeekDays": "...