About Me

My photo
I am an MCSE in Data Management and Analytics, specializing in MS SQL Server, and an MCP in Azure. With over 19+ years of experience in the IT industry, I bring expertise in data management, Azure Cloud, Data Center Migration, Infrastructure Architecture planning, as well as Virtualization and automation. I have a deep passion for driving innovation through infrastructure automation, particularly using Terraform for efficient provisioning. If you're looking for guidance on automating your infrastructure or have questions about Azure, SQL Server, or cloud migration, feel free to reach out. I often write to capture my own experiences and insights for future reference, but I hope that sharing these experiences through my blog will help others on their journey as well. Thank you for reading!

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: