-
Notifications
You must be signed in to change notification settings - Fork 59
/
mix2swa.ps1
120 lines (101 loc) · 6.5 KB
/
mix2swa.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
cd src
#(Get-Content Swastika-IO.sln) | ForEach-Object { $_ -creplace "Mix", "Sio" } | Set-Content Swastika-IO.sln
#Get-ChildItem -Path *Mix*.csproj* -File -Recurse | ForEach-Object -Process {
# (Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "Mix", "Sio" } | Set-Content $_.FullName
# Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "Mix","Sio") -Verbose
#}
[string[]]$excludefiles = @('package.json','package-lock.json', 'project.assets.json')
Get-ChildItem -Path *.sln -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "Mix", "Sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "Mix","Sio") -Verbose
}
Get-ChildItem -Path *.sln -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "mix", "sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "mix","sio") -Verbose
}
Get-ChildItem -Path *.project -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -replace "mix", "sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -replace "mix","sio") -Verbose
}
Get-ChildItem -Path *.csproj -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "Mix", "Sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "Mix","Sio") -Verbose
}
Get-ChildItem -Path *.csproj -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "mix", "sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "mix","sio") -Verbose
}
Get-ChildItem -Path *.cs -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "Mix", "Sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "Mix","Sio") -Verbose
}
Get-ChildItem -Path *.cs -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "mix", "sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "mix","sio") -Verbose
}
Get-ChildItem -Path *.cshtml -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "Mix", "Sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "Mix","Sio") -Verbose
}
Get-ChildItem -Path *.cshtml -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "mix", "sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "mix","sio") -Verbose
}
Get-ChildItem -Path *.json -File -Recurse -exclude package.json,package-lock.json,project.assets.json | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "Mix", "Sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "Mix","Sio") -Verbose
}
Get-ChildItem -Path *.json -File -Recurse -exclude package.json,package-lock.json,project.assets.json | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "mix","sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "mix","sio") -Verbose
}
Get-ChildItem -Path *.html -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "Mix", "Sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "Mix","Sio") -Verbose
}
Get-ChildItem -Path *.html -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "mix","sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "mix","sio") -Verbose
}
Get-ChildItem -Path *.js -File -Recurse -exclude chartjs.min.js,aes.js,crypto-js.js,vendor.min.js | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "Mix", "Sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "Mix","Sio") -Verbose
}
Get-ChildItem -Path *.js -File -Recurse -exclude chartjs.min.js,aes.js,crypto-js.js,vendor.min.js | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "mix", "sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "mix","sio") -Verbose
}
Get-ChildItem -Path *.css -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "Mix", "Sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "Mix","Sio") -Verbose
}
Get-ChildItem -Path *.css -File -Recurse | ForEach-Object -Process {
(Get-Content -LiteralPath $_.FullName) | ForEach-Object { $_ -creplace "mix", "sio" } | Set-Content $_.FullName
Rename-item -LiteralPath $_.FullName -NewName ($_.name -creplace "mix","sio") -Verbose
}
#Get-ChildItem -Path Mix* -Directory | ForEach-Object -Process {
# Rename-item -LiteralPath $_.FullName -NewName ($_.Name -creplace "Mix","Sio") -Verbose
#}
$OldText = "Mix"
$NewText = "Sio"
Get-ChildItem $Path -Recurse | %{$_.FullName} |
Sort-Object -Property Length -Descending |
% {
Write-Host $_
$Item = Get-Item $_
$PathRoot = $Item.FullName | Split-Path
$OldName = $Item.FullName | Split-Path -Leaf
$NewName = $OldName -creplace $OldText, $NewText
$NewPath = $PathRoot | Join-Path -ChildPath $NewName
if (!$Item.PSIsContainer -and $Extension -contains $Item.Extension) {
(Get-Content $Item) | % {
#Write-Host $_
$_ -creplace $OldText, $NewText
} | Set-Content $Item
}
if ($OldName.Contains($OldText)) {
Rename-Item -LiteralPath $Item.FullName -NewName $NewPath -Verbose
#Write-Host $NewPath
}
}
# Get-ChildItem -Path *ESX* -Directory | ForEach-Object -Process {Rename-item -Path $_.Name -NewName ($_.name -creplace "ESX","VMWARE") -Verbose}