NobGit
public imalexnord read

ms.open

Adds Mac "Open ." command to Windows

Languages

Repository composition by tracked source files.

PowerShell
PowerShell 100%
Create file Wiki Documentation
Clone
https://nobgit.com/user/imalexnord/ms.open.git
ssh://[email protected]:2222/user/imalexnord/ms.open.git

Trace

uninstall.ps1

Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.

uninstall.ps1 on main
Author Date Commit Line Code
Alex Nord 11 days ago a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
1
[CmdletBinding()]
Open commit View diff
1 [CmdletBinding()]
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
2
param()
Open commit View diff
2 param()
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
3
Open commit View diff
3
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
4
Set-StrictMode -Version Latest
Open commit View diff
4 Set-StrictMode -Version Latest
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
5
$ErrorActionPreference = 'Stop'
Open commit View diff
5 $ErrorActionPreference = 'Stop'
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
6
Open commit View diff
6
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
7
$root = $PSScriptRoot
Open commit View diff
7 $root = $PSScriptRoot
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
8
$binPath = Join-Path $root 'bin'
Open commit View diff
8 $binPath = Join-Path $root 'bin'
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
9
Open commit View diff
9
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
10
function Normalize-PathEntry {
Open commit View diff
10 function Normalize-PathEntry {
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
11
    param([string]$Value)
Open commit View diff
11 param([string]$Value)
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
12
Open commit View diff
12
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
13
    if ([string]::IsNullOrWhiteSpace($Value)) {
Open commit View diff
13 if ([string]::IsNullOrWhiteSpace($Value)) {
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
14
        return ''
Open commit View diff
14 return ''
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
15
    }
Open commit View diff
15 }
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
16
Open commit View diff
16
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
17
    return $Value.Trim().TrimEnd('\')
Open commit View diff
17 return $Value.Trim().TrimEnd('\')
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
18
}
Open commit View diff
18 }
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
19
Open commit View diff
19
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
20
function Remove-UserPath {
Open commit View diff
20 function Remove-UserPath {
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
21
    param([string]$PathToRemove)
Open commit View diff
21 param([string]$PathToRemove)
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
22
Open commit View diff
22
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
23
    $current = [Environment]::GetEnvironmentVariable('Path', 'User')
Open commit View diff
23 $current = [Environment]::GetEnvironmentVariable('Path', 'User')
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
24
    $normalizedTarget = Normalize-PathEntry $PathToRemove
Open commit View diff
24 $normalizedTarget = Normalize-PathEntry $PathToRemove
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
25
Open commit View diff
25
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
26
    $entries = @(
Open commit View diff
26 $entries = @(
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
27
        $current -split ';' |
Open commit View diff
27 $current -split ';' |
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
28
        ForEach-Object { Normalize-PathEntry $_ } |
Open commit View diff
28 ForEach-Object { Normalize-PathEntry $_ } |
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
29
        Where-Object {
Open commit View diff
29 Where-Object {
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
30
            $_ -and -not $_.Equals($normalizedTarget, [StringComparison]::OrdinalIgnoreCase)
Open commit View diff
30 $_ -and -not $_.Equals($normalizedTarget, [StringComparison]::OrdinalIgnoreCase)
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
31
        }
Open commit View diff
31 }
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
32
    )
Open commit View diff
32 )
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
33
Open commit View diff
33
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
34
    [Environment]::SetEnvironmentVariable('Path', ($entries -join ';'), 'User')
Open commit View diff
34 [Environment]::SetEnvironmentVariable('Path', ($entries -join ';'), 'User')
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
35
    Write-Host "Removed from user PATH: $PathToRemove"
Open commit View diff
35 Write-Host "Removed from user PATH: $PathToRemove"
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
36
}
Open commit View diff
36 }
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
37
Open commit View diff
37
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
38
function Remove-ProfileBlock {
Open commit View diff
38 function Remove-ProfileBlock {
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
39
    param([string]$ProfilePath)
Open commit View diff
39 param([string]$ProfilePath)
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
40
Open commit View diff
40
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
41
    if (-not (Test-Path -LiteralPath $ProfilePath)) {
Open commit View diff
41 if (-not (Test-Path -LiteralPath $ProfilePath)) {
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
42
        return
Open commit View diff
42 return
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
43
    }
Open commit View diff
43 }
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
44
Open commit View diff
44
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
45
    $beginMarker = '# >>> MS.Open >>>'
Open commit View diff
45 $beginMarker = '# >>> MS.Open >>>'
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
46
    $endMarker = '# <<< MS.Open <<<'
Open commit View diff
46 $endMarker = '# <<< MS.Open <<<'
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
47
    $content = Get-Content -LiteralPath $ProfilePath -Raw
Open commit View diff
47 $content = Get-Content -LiteralPath $ProfilePath -Raw
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
48
    $pattern = "(?ms)^$([regex]::Escape($beginMarker)).*?^$([regex]::Escape($endMarker))\s*"
Open commit View diff
48 $pattern = "(?ms)^$([regex]::Escape($beginMarker)).*?^$([regex]::Escape($endMarker))\s*"
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
49
    $cleaned = [regex]::Replace($content, $pattern, '').TrimEnd()
Open commit View diff
49 $cleaned = [regex]::Replace($content, $pattern, '').TrimEnd()
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
50
Open commit View diff
50
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
51
    if ($cleaned) {
Open commit View diff
51 if ($cleaned) {
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
52
        Set-Content -LiteralPath $ProfilePath -Value "$cleaned`r`n" -Encoding UTF8
Open commit View diff
52 Set-Content -LiteralPath $ProfilePath -Value "$cleaned`r`n" -Encoding UTF8
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
53
    }
Open commit View diff
53 }
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
54
    else {
Open commit View diff
54 else {
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
55
        Set-Content -LiteralPath $ProfilePath -Value '' -Encoding UTF8
Open commit View diff
55 Set-Content -LiteralPath $ProfilePath -Value '' -Encoding UTF8
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
56
    }
Open commit View diff
56 }
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
57
Open commit View diff
57
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
58
    Write-Host "Removed MS.Open from profile: $ProfilePath"
Open commit View diff
58 Write-Host "Removed MS.Open from profile: $ProfilePath"
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
59
}
Open commit View diff
59 }
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
60
Open commit View diff
60
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
61
Remove-UserPath -PathToRemove $binPath
Open commit View diff
61 Remove-UserPath -PathToRemove $binPath
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
62
Open commit View diff
62
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
63
$documents = [Environment]::GetFolderPath('MyDocuments')
Open commit View diff
63 $documents = [Environment]::GetFolderPath('MyDocuments')
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
64
$profiles = @(
Open commit View diff
64 $profiles = @(
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
65
    (Join-Path $documents 'WindowsPowerShell\Microsoft.PowerShell_profile.ps1'),
Open commit View diff
65 (Join-Path $documents 'WindowsPowerShell\Microsoft.PowerShell_profile.ps1'),
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
66
    (Join-Path $documents 'PowerShell\Microsoft.PowerShell_profile.ps1')
Open commit View diff
66 (Join-Path $documents 'PowerShell\Microsoft.PowerShell_profile.ps1')
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
67
) | Select-Object -Unique
Open commit View diff
67 ) | Select-Object -Unique
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
68
Open commit View diff
68
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
69
foreach ($profilePath in $profiles) {
Open commit View diff
69 foreach ($profilePath in $profiles) {
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
70
    Remove-ProfileBlock -ProfilePath $profilePath
Open commit View diff
70 Remove-ProfileBlock -ProfilePath $profilePath
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
71
}
Open commit View diff
71 }
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
72
Open commit View diff
72
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
73
Write-Host ''
Open commit View diff
73 Write-Host ''
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
74
Write-Host 'MS.Open has been uninstalled from PATH and PowerShell profiles.'
Open commit View diff
74 Write-Host 'MS.Open has been uninstalled from PATH and PowerShell profiles.'
same change a6e9016

Added more mac commmands

Full commit hash
a6e9016ab8de81fdc3afb3d4d20e378cf4a6a92f
Author
Alex Nord <[email protected]>
Date
11 days ago
Selected line
75
Write-Host 'Restart your terminal. You can then delete this folder.'
Open commit View diff
75 Write-Host 'Restart your terminal. You can then delete this folder.'