Skip to content

Commit ab862a6

Browse files
committed
Use spaces instead of tabs
1 parent 9299f0b commit ab862a6

File tree

11 files changed

+953
-953
lines changed

11 files changed

+953
-953
lines changed

.vscode/launch.json

+40-40
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
{
2-
"version": "0.1.0",
3-
"configurations": [
4-
{
5-
"name": "Launch Extension",
6-
"type": "extensionHost",
7-
"request": "launch",
8-
"runtimeExecutable": "${execPath}",
9-
"args": [ "--extensionDevelopmentPath=${workspaceRoot}" ],
10-
"stopOnEntry": false,
11-
"sourceMaps": true,
12-
"outFiles": ["${workspaceFolder}/out/src/**/*.js"],
13-
"preLaunchTask": "BuildAll"
14-
},
15-
{
16-
"name": "Launch Extension (Build client only)",
17-
"type": "extensionHost",
18-
"request": "launch",
19-
"runtimeExecutable": "${execPath}",
20-
"args": [ "--extensionDevelopmentPath=${workspaceFolder}" ],
21-
"stopOnEntry": false,
22-
"sourceMaps": true,
23-
"outFiles": ["${workspaceFolder}/out/src/**/*.js"],
24-
"preLaunchTask": "Build"
25-
},
26-
{
27-
"name": "Launch Extension Tests",
28-
"type": "extensionHost",
29-
"request": "launch",
30-
"runtimeExecutable": "${execPath}",
31-
"args": [
32-
"--disable-extensions",
33-
"--enable-proposed-api", "ms-vscode.powershell-preview",
34-
"--extensionDevelopmentPath=${workspaceFolder}",
35-
"--extensionTestsPath=${workspaceFolder}/out/test/testRunner.js",
36-
"${workspaceFolder}/test"
37-
],
38-
"outFiles": ["${workspaceFolder}/out/**/*.js"],
39-
"preLaunchTask": "Build"
40-
}
41-
]
2+
"version": "0.1.0",
3+
"configurations": [
4+
{
5+
"name": "Launch Extension",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"runtimeExecutable": "${execPath}",
9+
"args": [ "--extensionDevelopmentPath=${workspaceRoot}" ],
10+
"stopOnEntry": false,
11+
"sourceMaps": true,
12+
"outFiles": ["${workspaceFolder}/out/src/**/*.js"],
13+
"preLaunchTask": "BuildAll"
14+
},
15+
{
16+
"name": "Launch Extension (Build client only)",
17+
"type": "extensionHost",
18+
"request": "launch",
19+
"runtimeExecutable": "${execPath}",
20+
"args": [ "--extensionDevelopmentPath=${workspaceFolder}" ],
21+
"stopOnEntry": false,
22+
"sourceMaps": true,
23+
"outFiles": ["${workspaceFolder}/out/src/**/*.js"],
24+
"preLaunchTask": "Build"
25+
},
26+
{
27+
"name": "Launch Extension Tests",
28+
"type": "extensionHost",
29+
"request": "launch",
30+
"runtimeExecutable": "${execPath}",
31+
"args": [
32+
"--disable-extensions",
33+
"--enable-proposed-api", "ms-vscode.powershell-preview",
34+
"--extensionDevelopmentPath=${workspaceFolder}",
35+
"--extensionTestsPath=${workspaceFolder}/out/test/testRunner.js",
36+
"${workspaceFolder}/test"
37+
],
38+
"outFiles": ["${workspaceFolder}/out/**/*.js"],
39+
"preLaunchTask": "Build"
40+
}
41+
]
4242
}

build/InstallPreview.ps1

+26-26
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@
33
$ErrorActionPreference = "SilentlyContinue"
44
if ((Get-Process -Name "Code").Count -gt 0)
55
{
6-
Write-Warning "Visual Studio Code is currently running. You must close all VS Code windows before continuing."
6+
Write-Warning "Visual Studio Code is currently running. You must close all VS Code windows before continuing."
77
}
88
else
99
{
10-
# Fail fast on future errors
11-
$ErrorActionPreference = "Stop"
12-
13-
$destPath = "$env:USERPROFILE\.vscode\extensions\vscode-powershell\"
14-
15-
if (Test-Path $destPath)
16-
{
17-
Remove-Item $destPath -Recurse
18-
}
19-
20-
Write-Output "Installing to $destPath"
21-
Expand-Archive -Path ".\vscode-powershell.zip" -DestinationPath $destPath
22-
23-
if ($?)
24-
{
25-
Write-Output "Installation complete!"
26-
Write-Output ""
27-
Write-Output "Launching Visual Studio Code..."
28-
29-
& "${env:ProgramFiles(x86)}\Microsoft VS Code\Code.exe" "$destPath\examples\" "$destPath\examples\README.md" 2>&1 | Out-Null
30-
}
31-
else
32-
{
33-
Write-Output "Installation failed!"
34-
}
10+
# Fail fast on future errors
11+
$ErrorActionPreference = "Stop"
12+
13+
$destPath = "$env:USERPROFILE\.vscode\extensions\vscode-powershell\"
14+
15+
if (Test-Path $destPath)
16+
{
17+
Remove-Item $destPath -Recurse
18+
}
19+
20+
Write-Output "Installing to $destPath"
21+
Expand-Archive -Path ".\vscode-powershell.zip" -DestinationPath $destPath
22+
23+
if ($?)
24+
{
25+
Write-Output "Installation complete!"
26+
Write-Output ""
27+
Write-Output "Launching Visual Studio Code..."
28+
29+
& "${env:ProgramFiles(x86)}\Microsoft VS Code\Code.exe" "$destPath\examples\" "$destPath\examples\README.md" 2>&1 | Out-Null
30+
}
31+
else
32+
{
33+
Write-Output "Installation failed!"
34+
}
3535
}

build/PackagePreviewRelease.ps1

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,33 @@ $ErrorActionPreference = "Stop"
55
# Simple test to make sure we're in the root folder
66
if (!(Test-Path "package.json"))
77
{
8-
throw "This script must be run from the root vscode-powershell folder (contains package.json)."
8+
throw "This script must be run from the root vscode-powershell folder (contains package.json)."
99
}
1010

1111
if ([string]::IsNullOrEmpty($EditorServicesRepoPath) -or !(Test-Path $EditorServicesRepoPath))
1212
{
13-
throw "Must provide path to a PowerShell Editor Services Git repository"
13+
throw "Must provide path to a PowerShell Editor Services Git repository"
1414
}
1515

1616
$hostBinPath = Join-Path $EditorServicesRepoPath "src\PowerShellEditorServices.Host\bin\Debug"
1717

1818
if (!(Test-Path $hostBinPath))
1919
{
20-
throw "The path '$hostBinPath' was not found. Has the Editor Services solution been compiled?"
20+
throw "The path '$hostBinPath' was not found. Has the Editor Services solution been compiled?"
2121
}
2222

2323
Remove-Item -Path ".\bin\*"
2424
Copy-Item -Path "$hostBinPath\*" -Include ("*.exe", "*.dll", "*.pdb", "*.xml") -Exclude ("*.vshost.exe") -Destination ".\bin"
2525

2626
$packageFiles = @(
27-
"out",
28-
"bin",
29-
#"LICENSE",
30-
"package.json",
31-
#"README.md",
32-
"Third Party Notices.txt",
33-
"snippets",
34-
"examples"
27+
"out",
28+
"bin",
29+
#"LICENSE",
30+
"package.json",
31+
#"README.md",
32+
"Third Party Notices.txt",
33+
"snippets",
34+
"examples"
3535
)
3636

3737
# Build the extension files package

docs/community_snippets.md

+39-39
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ Connect to Exchange Online, by @vmsilvamolina
171171
"prefix": "ex-ExchangeOnlineConnection",
172172
"body": [
173173
"#Set Execution Policy",
174-
"Set-ExecutionPolicy RemoteSigned -Scope Process",
175-
"#Define credential",
176-
"\\$UserCredential = Get-Credential",
177-
"# Create the session",
178-
"\\$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential \\$UserCredential -Authentication Basic -AllowRedirection",
179-
"Import-PSSession \\$Session -DisableNameChecking"
174+
"Set-ExecutionPolicy RemoteSigned -Scope Process",
175+
"#Define credential",
176+
"\\$UserCredential = Get-Credential",
177+
"# Create the session",
178+
"\\$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential \\$UserCredential -Authentication Basic -AllowRedirection",
179+
"Import-PSSession \\$Session -DisableNameChecking"
180180
],
181181
"description": "Connect to Exchange Online"
182182
}
@@ -193,18 +193,18 @@ Add HTML header to a variable with the style tag (for css).
193193
"prefix": "ex-AddHTMLheader",
194194
"body": [
195195
"#HTML file and styles",
196-
"\\$htmlHeader = @\"",
197-
"<!doctype html\">",
198-
"<html lang=\"e\">",
199-
"<head>",
200-
"<meta charset=\"UTF-8\">",
201-
"<title>${1:Title}</title>",
202-
"<style type=\"text/css\">",
203-
"body {",
204-
"}",
205-
"</style>",
206-
"</head>",
207-
"\"@"
196+
"\\$htmlHeader = @\"",
197+
"<!doctype html\">",
198+
"<html lang=\"e\">",
199+
"<head>",
200+
"<meta charset=\"UTF-8\">",
201+
"<title>${1:Title}</title>",
202+
"<style type=\"text/css\">",
203+
"body {",
204+
"}",
205+
"</style>",
206+
"</head>",
207+
"\"@"
208208
],
209209
"description": "Add HTML header section"
210210
}
@@ -316,36 +316,36 @@ Add the Send-MailMessage cmdlet with the most common parameters in a hashtable f
316316
#### Snippet
317317

318318
```json
319-
"ex-Send-MailMessage": {
320-
"prefix": "ex-Send-MailMessage",
321-
"body": [
322-
"$$Params = @{",
323-
" 'SmtpServer' = 'smtp.mycompany.com'",
324-
" 'Port' = 25",
325-
" 'Priority' = 'Normal'",
326-
" 'From' = '[email protected]'",
327-
" 'To' = '[email protected]'",
328-
" 'Cc' = '[email protected]'",
329-
" 'Bcc' = '[email protected]'",
330-
" 'Subject' = 'Mail title'",
331-
" 'Body' = 'This is the content of my mail'",
332-
" 'BodyAsHtml' = $$false",
333-
" 'Attachments' = 'c:\\MyFile.txt'",
334-
"}",
335-
"Send-MailMessage @Params"
336-
],
337-
"description": "Send a mail message"
319+
"ex-Send-MailMessage": {
320+
"prefix": "ex-Send-MailMessage",
321+
"body": [
322+
"$$Params = @{",
323+
" 'SmtpServer' = 'smtp.mycompany.com'",
324+
" 'Port' = 25",
325+
" 'Priority' = 'Normal'",
326+
" 'From' = '[email protected]'",
327+
" 'To' = '[email protected]'",
328+
" 'Cc' = '[email protected]'",
329+
" 'Bcc' = '[email protected]'",
330+
" 'Subject' = 'Mail title'",
331+
" 'Body' = 'This is the content of my mail'",
332+
" 'BodyAsHtml' = $$false",
333+
" 'Attachments' = 'c:\\MyFile.txt'",
334+
"}",
335+
"Send-MailMessage @Params"
336+
],
337+
"description": "Send a mail message"
338338
}
339339
```
340340

341341
## Contributing
342342

343343
To optimize snippet usability and discoverability for end users we will only ship snippets in the extension which we believe meet the following requirements:
344344
- Must be broadly applicable to most PowerShell extension users
345-
- Must be substantially different from existing snippets or intellisense
345+
- Must be substantially different from existing snippets or intellisense
346346
- Must not violate any intellectual property rights
347347

348-
If your snippet does not meet these requirements but would still be useful to customers we will include it in our list of [Awesome Community Snippets](https://github.com/PowerShell/vscode-powershell/blob/master/docs/community_snippets.md). Additionally, snippet creators can publish snippet libraries as standalone extensions in the [VSCode Marketplace](https://code.visualstudio.com/api/working-with-extensions/publishing-extension).
348+
If your snippet does not meet these requirements but would still be useful to customers we will include it in our list of [Awesome Community Snippets](https://github.com/PowerShell/vscode-powershell/blob/master/docs/community_snippets.md). Additionally, snippet creators can publish snippet libraries as standalone extensions in the [VSCode Marketplace](https://code.visualstudio.com/api/working-with-extensions/publishing-extension).
349349

350350
If you'd like a snippet to be considered for addition to the list, [open a pull request](https://opensource.guide/how-to-contribute/#opening-a-pull-request) with the following changes:
351351

examples/Stop-Process2.ps1

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
<#
22
.Synopsis
3-
Short description
3+
Short description
44
.DESCRIPTION
5-
Long description
5+
Long description
66
.EXAMPLE
7-
Example of how to use this cmdlet
7+
Example of how to use this cmdlet
88
.EXAMPLE
9-
Another example of how to use this cmdlet
9+
Another example of how to use this cmdlet
1010
#>
1111
function Stop-Process2 {
12-
[CmdletBinding(SupportsShouldProcess = $true)]
13-
[Alias()]
14-
[OutputType([int])]
15-
param(
16-
# Param1 help description
17-
[Parameter(Mandatory=$true,
18-
ValueFromPipelineByPropertyName=$true,
19-
Position=0)]
20-
$Name
21-
)
12+
[CmdletBinding(SupportsShouldProcess = $true)]
13+
[Alias()]
14+
[OutputType([int])]
15+
param(
16+
# Param1 help description
17+
[Parameter(Mandatory=$true,
18+
ValueFromPipelineByPropertyName=$true,
19+
Position=0)]
20+
$Name
21+
)
2222

23-
process {
24-
if ($PSCmdlet.ShouldProcess("")) {
25-
$processes = Get-Process -Name $Name
26-
foreach ($process in $processes) {
27-
$id = $process.Id
28-
$name = $process.Name
29-
Write-Output "Killing $name ($id)"
23+
process {
24+
if ($PSCmdlet.ShouldProcess("")) {
25+
$processes = Get-Process -Name $Name
26+
foreach ($process in $processes) {
27+
$id = $process.Id
28+
$name = $process.Name
29+
Write-Output "Killing $name ($id)"
3030

31-
$process.Kill();
31+
$process.Kill();
3232

33-
Start-Sleep -Seconds 1
34-
}
35-
}
36-
}
33+
Start-Sleep -Seconds 1
34+
}
35+
}
36+
}
3737
}

0 commit comments

Comments
 (0)