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 run Glenn Berry Scripts from Powershell and store output to the Excel



How to run GlenBerry Script from Powershell and store output to the Excel




Go to PowerShell & execute below set of commands


PS C:\WINDOWS\system32> Install-Module -Name ImportExcel

PS C:\WINDOWS\system32> Install-Module dbatools

PS C:\WINDOWS\system32> Install-Module -Name SqlServer

PS C:\WINDOWS\system32> (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/sanderstad/Export-DMVInformation/master/Get-ExportDMVInformation.ps1") | iex

Then

PS C:\WINDOWS\system32> import-Module ImportExcel
PS C:\WINDOWS\system32> import-Module dbatools
PS C:\WINDOWS\system32> import-Module sqlserver
PS C:\WINDOWS\system32> import-Module Export-DMVInformation
PS C:\WINDOWS\system32> hostname
DESKTOP-FFOU2GS
PS C:\WINDOWS\system32> Export-DMVInformation -instance 'DESKTOP-FFOU2GS'

Starting DMV Information Retrieval:
- Instance:    DESKTOP-FFOU2GS
- Database:    ALL
- Destination: C:\Users\Admin\Documents\dmv\results

No comments: