Microsoft.Net Developer
Azure KeyVault: Retrieve secrets and their values using PowerShell and save in Excel file
Azure KeyVault: Retrieve secrets and their values
Azure KeyVault: Retrieve secrets and their values
using PowerShell
$vault_name = "keyvault-name"
# Get all secret names
$secret_names=$(az keyvault secret list --vault-name $vault_name --query [].name -o tsv)
# Loop through each secret name and get its value
foreach ($secret in $secret_names)
{
$secret_value=$(az keyvault secret show --vault-name $vault_name --name $secret --query "value")
Write-Output $secret
Write-Output $secret_value
Write-Output "-------------------------"
}
Create an Excel file using PowerShell script
Create an Excel file using PowerShell script
Here is a code to write data into Excel file and save it in a particular path.
$excel = New-Object -ComObject excel.application
#$excel.visible = $True
$workbook = $excel.Workbooks.Add()
$SheetName = "MySheet"
$uregwksht= $workbook.Worksheets.Item(1)
$uregwksht.Name = $SheetName
$row = 1
$Column = 1
$uregwksht.Cells.Item($row,$column)= "Column Title"
for ($i = 2; $i -le 5; $i++)
{
Write-Output $i
$row = $row + 1
$uregwksht.Cells.Item($row,$column)= "Abcd" + $i
}
$outputpath = "D:\test.xlsx"
$excel.displayalerts = $false
$workbook.Saveas($outputpath)
$excel.displayalerts = $true
Write-Output $("File saved on " + $outputpath )
$excel.Quit()
#ref - https://community.spiceworks.com/t/create-an-excel-file-from-within-powershell/1011485
#ref - https://chanmingman.wordpress.com/2022/10/02/powershell-write-to-excel-file/
React Native - Call API on Button Click
React Native - Call API on Button Click
docker build sh: react-scripts: not found
docker build sh: react-scripts: not found
Issue
docker build sh: react-scripts: not found
Solution
Deleting package-lock.json and re-installing packages with npm install before building the container solved the issue for me.
Data is Null. This method or property cannot be called on Null values
Data is Null. This method or property cannot be called on Null values
Issue:
Data is Null. This method or property cannot be called on Null values
Solution:
For columns that are nullable in your DB tables:
Wrong
public string Memo { get; set; }
Correct:
public string? Memo { get; set; }
The term 'New-AzResourceGroup' is not recognized as the name of a cmdlet, function, script fiel or operable program.
The term 'New-AzResourceGroup' is not recognized as the name of a cmdlet, function, script fiel or operable program.
Issue:
New-AzResourceGroup : The term 'New-AzResourceGroup' 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.
At line:1 char:1
+ New-AzResourceGroup
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-AzResourceGroup:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Solution:
You need to install the Azure Powershell module:
You can look for just the one for this command:
Install-Module -Name Az.Resources -AllowClobber -Scope CurrentUser
Or all of them:
Install-Module -Name Az -AllowClobber -Scope CurrentUser
-
Code First Migration in ASP.Net Core Generally we create database first and then we create data model classes in project, and while we pu...
-
Insert - Update SQL Database using Powershell Script Here is example of SQL Server database insert and update transaction using Powershel...
-
Git remote: HTTP Basic: Access denied and fatal Authentication Sometimes, I am facing issue with Git and getting error that - "Git...