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:
Post a Comment