-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-PowershellPath.html
83 lines (69 loc) · 3.19 KB
/
Get-PowershellPath.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>PowerShell - Get-PowershellPath - Carbon</title>
<link href="silk.css" type="text/css" rel="stylesheet" />
<link href="styles.css" type="text/css" rel="stylesheet" />
</head>
<body>
<ul id="SiteNav">
<li><a href="index.html">Get-Carbon</a></li>
<li><a href="about_Carbon_Installation.html">-Install</a></li>
<li><a href="documentation.html">-Documentation</a></li>
<li><a href="about_Carbon_Support.html">-Support</a></li>
<li><a href="releasenotes.html">-ReleaseNotes</a></li>
<li><a href="http://pshdo.com">-Blog</a></li>
<li><a href="https://github.com/webmd-health-services/Carbon/">-Project</a></li>
</ul>
<h1>Get-PowershellPath</h1>
<div class="Synopsis">
<p>Gets the path to powershell.exe.</p>
</div>
<h2>Syntax</h2>
<pre class="Syntax"><code>Get-PowershellPath [-x86] [<CommonParameters>]</code></pre>
<h2>Description</h2>
<div class="Description">
<p>Returns the path to the powershell.exe binary for the machine's default architecture (i.e. x86 or x64). If you're on a x64 machine and want to get the path to x86 PowerShell, set the <code>x86</code> switch.</p>
<p>Here are the possible combinations of operating system, PowerShell, and desired path architectures, and the path they map to.</p>
<pre><code>+-----+-----+------+--------------------------------------------------------------+
| OS | PS | Path | Result |
+-----+-----+------+--------------------------------------------------------------+
| x64 | x64 | x64 | $env:windir\System32\Windows PowerShell\v1.0\powershell.exe |
| x64 | x64 | x86 | $env:windir\SysWOW64\Windows PowerShell\v1.0\powershell.exe |
| x64 | x86 | x64 | $env:windir\sysnative\Windows PowerShell\v1.0\powershell.exe |
| x64 | x86 | x86 | $env:windir\SysWOW64\Windows PowerShell\v1.0\powershell.exe |
| x86 | x86 | x64 | $env:windir\System32\Windows PowerShell\v1.0\powershell.exe |
| x86 | x86 | x86 | $env:windir\System32\Windows PowerShell\v1.0\powershell.exe |
+-----+-----+------+--------------------------------------------------------------+
</code></pre>
</div>
<h2> Parameters </h2>
<table id="Parameters">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required?</th>
<th>Pipeline Input</th>
<th>Default Value</th>
</tr>
<tr valign='top'>
<td>x86</td>
<td><a href="http://msdn.microsoft.com/en-us/library/system.management.automation.switchparameter.aspx">SwitchParameter</a></td>
<td class="ParamDescription"><p>Gets the path to 32-bit PowerShell.</p></td>
<td>false</td>
<td>false</td>
<td>False</td>
</tr>
</table>
<h2>EXAMPLE 1</h2>
<pre><code>Get-PowerShellPath</code></pre>
<p>Returns the path to the version of PowerShell that matches the computer's architecture (i.e. x86 or x64).</p>
<h2>EXAMPLE 2</h2>
<pre><code>Get-PowerShellPath -x86</code></pre>
<p>Returns the path to the x86 version of PowerShell.</p>
<div class="Footer">
Copyright 2012 - 2018 <a href="http://pshdo.com">Aaron Jensen</a>.
</div>
</body>
</html>