Skip to content

Instantly share code, notes, and snippets.

@viksingh
Created June 21, 2019 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viksingh/2f0774ee89b8e6c332128861b97c38b8 to your computer and use it in GitHub Desktop.
Save viksingh/2f0774ee89b8e6c332128861b97c38b8 to your computer and use it in GitHub Desktop.
# Provide the name of your resource group
$ResourceGroupName="**********"
# Provide the name of your Storage account.
$StorageAccountName="**************"
# Provide the Storage account key
$StorageAccountKey = '**********'
# Provide the name for your Azure Files share.
$ShareName = "modulecode3" //File share name in the storage account
# Provide the name for your Directory.
$DirectoryName = "RunbookOne" //Filename for download
# Provide the full path to the file you want to upload.
$FullPathToFile = (Get-Module -ListAvailable <ModuleName>).path
Write-Output 'Path to manifest file' $FullPathToFile
$FullPathToFile = $FullPathToFile.replace("psd1","psm1")
Write-Output 'Path to script module file' $FullPathToFile
$Context = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
# Upload a file to the directory in the file share
Set-AzureStorageFileContent -ShareName $ShareName -Source $FullPathToFile -Path $DirectoryName -Context $Context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment