About Me

My photo
I am MCSE in Data Management and Analytics with specialization in MS SQL Server and MCP in Azure. I have over 13+ years of experience in IT industry with expertise in data management, Azure Cloud, Data-Canter Migration, Infrastructure Architecture planning and Virtualization and automation. Contact me if you are looking for any sort of guidance in getting your Infrastructure provisioning automated through Terraform. I sometime write for a place to store my own experiences for future search and read by own blog but can hopefully help others along the way. Thanks.

How to create a DSC File for Azure data Studio

launch powershell ISE in Administrator mode
save the file as InstallAzureDataStudio.ps1
if your  VM does not have PSDesiredStateConfiguration module installed

Go to Powershell console and execute below command

 PS C:\Users\admina> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

PS C:\Users\admina> Install-packageProvider -name Nuget

PS C:\Users\admina> Install-Module -Name xPSDesiredStateConfiguration -Force

PS C:\Users\admina>

go to the File "InstallAzureDataStudio.ps1"
 and execute this File, this DSC will create a Folder name xfer in C:\ drive.



 Configuration InstallAzureDataStudio
{
   Import-DscResource -ModuleName PSDesiredStateConfiguration
   #Import-DscResource -ModuleName xPSDesiredStateConfiguration

File SetupDir
 {
   Type = 'File'
   SourcePath = "C:\Users\admina\Downloads\azuredatastudio-windows-setup-1.17.0.exe" #This path should exists
   DestinationPath = 'C:\xfer\'
   Ensure = "Present"
  }

  Log AfterFileCopy
        {
            # The message below gets written to the Microsoft-Windows-Desired State Configuration/Analytic log
            Message = "Finished copying file to C:\xfer........ "
            DependsOn = "[File]SetupDir" # Depends on successful execution of the File resource.
        }
     

Package AzureDataStudioPackage
 {
  Ensure = "Present"
  Name = "Azure Data Studio"
  Path= "C:\xfer\azuredatastudio-windows-setup-1.17.0.exe"
  ProductId = ""
  Arguments = "/VERYSILENT"
  }
 
}


InstallAzureDataStudio



First Command
------------------------------
PS C:\Users\admina> C:\xfer\InstallAzureDataStudio.ps1


    Directory: C:\Users\admina>InstallAzureDataStudio


Mode                LastWriteTime         Length Name                                                                             
----                -------------         ------ ----                                                                             
-a----        4/30/2020   6:46 AM           3060 localhost.mof


it has created .mof file in C:\Users\admina

Second Command
------------------------------
PS C:\Users\admina> Start-DscConfiguration -Path "C:\Users\admina\InstallAzureDataStudio\InstallAzureDataStudio" -Force -Wait -Verbose

output:-

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSC
LocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer rak-desc-test with user sid S-1-5-21-271070641-441374908-1635702522-500.
VERBOSE: [rak-desc-test]: LCM:  [ Start  Set      ]
VERBOSE: [rak-desc-test]: LCM:  [ Start  Resource ]  [[File]SetupDir]
VERBOSE: [rak-desc-test]: LCM:  [ Start  Test     ]  [[File]SetupDir]
VERBOSE: [rak-desc-test]:                            [[File]SetupDir] The destination object was found and no action is required.
VERBOSE: [rak-desc-test]: LCM:  [ End    Test     ]  [[File]SetupDir]  in 0.0160 seconds.
VERBOSE: [rak-desc-test]: LCM:  [ Skip   Set      ]  [[File]SetupDir]
VERBOSE: [rak-desc-test]: LCM:  [ End    Resource ]  [[File]SetupDir]
VERBOSE: [rak-desc-test]: LCM:  [ Start  Resource ]  [[Package]AzureDataStudioPackage]
VERBOSE: [rak-desc-test]: LCM:  [ Start  Test     ]  [[Package]AzureDataStudioPackage]
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] Validate-StandardArguments, Path was C:\setup\a
zuredatastudio-windows-setup-1.17.0.exe
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] The path extension was .exe
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] Ensure is Present
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] product installation cannot be determined
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] product as boolean is False
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] The package Azure Data Studio is not installed
VERBOSE: [rak-desc-test]: LCM:  [ End    Test     ]  [[Package]AzureDataStudioPackage]  in 0.0150 seconds.
VERBOSE: [rak-desc-test]: LCM:  [ Start  Set      ]  [[Package]AzureDataStudioPackage]
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] Validate-StandardArguments, Path was C:\setup\a
zuredatastudio-windows-setup-1.17.0.exe
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] The path extension was .exe
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] Ensure is Present
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] product installation cannot be determined
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] product as boolean is False
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] The package Azure Data Studio is not installed
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] Validate-StandardArguments, Path was C:\setup\a
zuredatastudio-windows-setup-1.17.0.exe
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] The path extension was .exe
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] Package configuration starting
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] The binary is an EXE
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] Starting C:\setup\azuredatastudio-windows-setup
-1.17.0.exe with /VERYSILENT
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] Starting process C:\setup\azuredatastudio-windo
ws-setup-1.17.0.exe with arguments /VERYSILENT
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] The machine requires a reboot
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] Package has been installed
VERBOSE: [rak-desc-test]:                            [[Package]AzureDataStudioPackage] Package configuration finished
VERBOSE: [rak-desc-test]: LCM:  [ End    Set      ]  [[Package]AzureDataStudioPackage]  in 23.9840 seconds.
VERBOSE: [rak-desc-test]: LCM:  [ End    Resource ]  [[Package]AzureDataStudioPackage]
VERBOSE: [rak-desc-test]:                            [] A reboot is required to progress further. Please reboot the system.
WARNING: [rak-desc-test]:                            [] A reboot is required to progress further. Please reboot the system.
VERBOSE: [rak-desc-test]: LCM:  [ End    Set      ]
VERBOSE: [rak-desc-test]: LCM:  [ End    Set      ]    in  24.1710 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 25.696 seconds

PS C:\Users\admina>

you will observe Azure data studio has successfully been installed and you will find the same in control panel.

Go to C:\Program Files\Azure Data Studio and launch azuredatastudio.exe


Thanks for Reading..

How to Fix the issue when you try to install a module xPDesiredStateConfiguration and it gets fail with below error..

How to Fix the issue when you try to install a module xPDesiredStateConfiguration and it gets fail with below error..

PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider
'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified
package has the tags.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7405 char:21
+ ...     $null = PackageManagement\Install-PackageProvider -Name $script:N ...



PS C:\Users\admina> Install-Module -Name xPDesiredStateConfiguration
WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider
'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified
package has the tags.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7405 char:21
+ ...     $null = PackageManagement\Install-PackageProvider -Name $script:N ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-P
   ackageProvider], Exception
    + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageP
   rovider

PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider name
'NuGet'. Try 'Get-PackageProvider -ListAvailable' to see if the provider exists on the system.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7411 char:21
+ ...     $null = PackageManagement\Import-PackageProvider -Name $script:Nu ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (NuGet:String) [Import-PackageProvider], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackagePr
   ovider

WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Get-PackageProvider : Unable to find package provider 'NuGet'. It may not be imported yet. Try
'Get-PackageProvider -ListAvailable'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7415 char:30
+ ... tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackagePro
   vider], Exception
    + FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPac
   kageProvider

Install-Module : NuGet provider is required to interact with NuGet-based repositories. Please ensure that
'2.8.5.201' or newer version of NuGet provider is installed.
At line:1 char:1
+ Install-Module -Name XPDesiredStateConfiguration
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Install-Module], InvalidOperationException
    + FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Install-Module


PS C:\Users\admina>

Resolution :-


in order to fix this issue

PS C:\Users\admina> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

PS C:\Users\admina> Install-packageProvider -name Nuget

PS C:\Users\admina> Install-Module -Name xPSDesiredStateConfiguration -Force

PS C:\Users\admina>