-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
340 additions
and
358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
'use strict'; | ||
import * as vscode from 'vscode'; | ||
import * as request from 'request-promise-native'; | ||
import {placeScript} from './placescript'; | ||
|
||
const baseUrl = "https://raw.githubusercontent.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/master/"; | ||
|
||
async function spblitzscript(baseUrl: string, fileName: string) { | ||
let options = { | ||
uri: baseUrl + fileName, | ||
}; | ||
console.log('Bringing in the first responder kit from the mothership.'); | ||
const scriptText = await request.get(options); | ||
new placeScript().placescript(fileName,scriptText); | ||
} | ||
|
||
//importing all first responder kit scripts | ||
export let getblitzall = async () => { | ||
await spblitzscript(baseUrl, "Install-All-Scripts.sql"); | ||
}; | ||
export let disposable_spblitzall = vscode.commands.registerCommand('extension.sp_blitzall', getblitzall); | ||
|
||
//importing spblitz script | ||
let getblitz = async () => { | ||
await spblitzscript(baseUrl,"sp_Blitz.sql"); | ||
}; | ||
export let disposable_spblitz = vscode.commands.registerCommand('extension.sp_blitz', getblitz); | ||
|
||
|
||
//importing spblitzcache script | ||
let getblitzcache = async () => { | ||
await spblitzscript(baseUrl, "sp_BlitzCache.sql"); | ||
}; | ||
export let disposable_spblitzcache = vscode.commands.registerCommand('extension.sp_blitzcache', getblitzcache); | ||
|
||
//importing spblitzfirst script | ||
let getblitzfirst = async () => { | ||
await spblitzscript(baseUrl, "sp_BlitzFirst.sql"); | ||
}; | ||
export let disposable_spblitzfirst = vscode.commands.registerCommand('extension.sp_blitzfirst', getblitzfirst); | ||
|
||
//importing spblitzwho script | ||
let getblitzwho = async () => { | ||
await spblitzscript(baseUrl, "sp_BlitzWho.sql"); | ||
}; | ||
export let disposable_spblitzwho = vscode.commands.registerCommand('extension.sp_blitzwho', getblitzwho); | ||
|
||
//importing spblitzindex script | ||
let getblitzindex = async () => { | ||
await spblitzscript(baseUrl, "sp_BlitzIndex.sql"); | ||
}; | ||
export let disposable_spblitzindex = vscode.commands.registerCommand('extension.sp_blitzindex', getblitzindex); |
Oops, something went wrong.