Skip to content

Commit 303cb08

Browse files
authored
Performance enhancement: do not load profile when using powershell Get-Clipboard (#641)
* Update LinuxClipboard_2.1.cs * Update LinuxClipboard_2.0.cs
1 parent 06e9d1d commit 303cb08

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/TextCopy/LinuxClipboard_2.0.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static string GetText()
4949
{
5050
if (isWsl)
5151
{
52-
BashRunner.Run($"powershell.exe Get-Clipboard > {tempFileName}");
52+
BashRunner.Run($"powershell.exe -NoProfile Get-Clipboard > {tempFileName}");
5353
}
5454
else
5555
{
@@ -63,4 +63,4 @@ public static string GetText()
6363
}
6464
}
6565
}
66-
#endif
66+
#endif

src/TextCopy/LinuxClipboard_2.1.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ static void InnerGetText(string tempFileName)
8080
{
8181
if (isWsl)
8282
{
83-
BashRunner.Run($"powershell.exe Get-Clipboard > {tempFileName}");
83+
BashRunner.Run($"powershell.exe -NoProfile Get-Clipboard > {tempFileName}");
8484
}
8585
else
8686
{
8787
BashRunner.Run($"xsel -o --clipboard > {tempFileName}");
8888
}
8989
}
9090
}
91-
#endif
91+
#endif

0 commit comments

Comments
 (0)