mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 02:48:30 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
1
extensions/powershell/.vscodeignore
Normal file
1
extensions/powershell/.vscodeignore
Normal file
@@ -0,0 +1 @@
|
||||
test/**
|
||||
7
extensions/powershell/OSSREADME.json
Normal file
7
extensions/powershell/OSSREADME.json
Normal file
@@ -0,0 +1,7 @@
|
||||
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS:
|
||||
[{
|
||||
"name": "SublimeText/PowerShell",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"repositoryURL": "https://github.com/SublimeText/PowerShell"
|
||||
}]
|
||||
26
extensions/powershell/language-configuration.json
Normal file
26
extensions/powershell/language-configuration.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"comments": {
|
||||
"lineComment": "#",
|
||||
"blockComment": [ "<#", "#>" ]
|
||||
},
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
],
|
||||
"autoClosingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
{ "open": "\"", "close": "\"", "notIn": ["string"]},
|
||||
{ "open": "'", "close": "'", "notIn": ["string", "comment"]},
|
||||
["/**", " */"]
|
||||
],
|
||||
"surroundingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"]
|
||||
]
|
||||
}
|
||||
22
extensions/powershell/package.json
Normal file
22
extensions/powershell/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "powershell",
|
||||
"version": "0.1.0",
|
||||
"publisher": "vscode",
|
||||
"engines": { "vscode": "*" },
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
"id": "powershell",
|
||||
"extensions": [ ".ps1", ".psm1", ".psd1", ".pssc", ".psrc" ],
|
||||
"aliases": [ "PowerShell", "powershell", "ps", "ps1" ],
|
||||
"configuration": "./language-configuration.json"
|
||||
}],
|
||||
"grammars": [{
|
||||
"language": "powershell",
|
||||
"scopeName": "source.powershell",
|
||||
"path": "./syntaxes/PowershellSyntax.tmLanguage"
|
||||
}]
|
||||
},
|
||||
"scripts": {
|
||||
"update-grammar": "node ../../build/npm/update-grammar.js SublimeText/PowerShell Support/PowershellSyntax.tmLanguage ./syntaxes/powershell.tmLanguage.json"
|
||||
}
|
||||
}
|
||||
1186
extensions/powershell/syntaxes/PowershellSyntax.tmLanguage
Normal file
1186
extensions/powershell/syntaxes/PowershellSyntax.tmLanguage
Normal file
File diff suppressed because it is too large
Load Diff
43
extensions/powershell/test/colorize-fixtures/test.ps1
Normal file
43
extensions/powershell/test/colorize-fixtures/test.ps1
Normal file
@@ -0,0 +1,43 @@
|
||||
# Copyright Microsoft Corporation
|
||||
|
||||
function Test-IsAdmin() {
|
||||
try {
|
||||
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
|
||||
$principal = New-Object Security.Principal.WindowsPrincipal -ArgumentList $identity
|
||||
return $principal.IsInRole( [Security.Principal.WindowsBuiltInRole]::Administrator )
|
||||
} catch {
|
||||
throw "Failed to determine if the current user has elevated privileges. The error was: '{0}'." -f $_
|
||||
}
|
||||
}
|
||||
|
||||
function Invoke-Environment()
|
||||
{
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory=1)][string]$Command
|
||||
)
|
||||
|
||||
foreach($_ in cmd /c "$Command 2>&1 & set") {
|
||||
if ($_ -match '^([^=]+)=(.*)') {
|
||||
[System.Environment]::SetEnvironmentVariable($matches[1], $matches[2])
|
||||
}
|
||||
}
|
||||
}
|
||||
Write-Host -Object 'Initializing Azure PowerShell environment...';
|
||||
|
||||
# PowerShell commands need elevation for dependencies installation and running tests
|
||||
if (!(Test-IsAdmin)){
|
||||
Write-Host -Object 'Please launch command under administrator account. It is needed for environment setting up and unit test.' -ForegroundColor Red;
|
||||
}
|
||||
|
||||
$env:AzurePSRoot = Split-Path -Parent -Path $env:AzurePSRoot;
|
||||
|
||||
if (Test-Path -Path "$env:ADXSDKProgramFiles\Microsoft Visual Studio 12.0") {
|
||||
$vsVersion="12.0"
|
||||
} else {
|
||||
$vsVersion="11.0"
|
||||
}
|
||||
|
||||
$setVSEnv = '"{0}\Microsoft Visual Studio {1}\VC\vcvarsall.bat" x64' -f $env:ADXSDKProgramFiles, $vsVersion;
|
||||
|
||||
Invoke-Environment -Command $setVSEnv;
|
||||
2422
extensions/powershell/test/colorize-results/test_ps1.json
Normal file
2422
extensions/powershell/test/colorize-results/test_ps1.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user