Skip to content

Commit 7e23485

Browse files
Merge pull request #2 from al-cheb/v-malob/fix-script-path
Fix script path
2 parents a52e86c + d0cece4 commit 7e23485

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dist/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ const run = () => {
184184
core.info(`- Minimum size: ${minimumSize}`);
185185
core.info(`- Maximum size: ${maximumSize}`);
186186
core.info(`- Disk root: ${diskRoot}`);
187-
const scriptPath = path.resolve(path.join("scripts", "SetPageFileSize.ps1"));
187+
const scriptPath = path.resolve(__dirname, "..", "scripts", "SetPageFileSize.ps1");
188188
const scriptArguments = [
189189
"-MinimumSize", minimumSize,
190190
"-MaximumSize", maximumSize,
@@ -193,7 +193,7 @@ const run = () => {
193193
core.debug("Invoke configuration script:");
194194
core.debug(`Script path: ${scriptPath}`);
195195
core.debug(`Script arguments: ${scriptArguments}`);
196-
const scriptResult = child.spawnSync("pwsh", ["-File", scriptPath, ...scriptArguments], {
196+
const scriptResult = child.spawnSync("powershell", [scriptPath, ...scriptArguments], {
197197
timeout: 60 * 1000
198198
});
199199
if (scriptResult.stdout) {

src/configure-pagefile.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const run = (): void => {
1717
core.info(`- Maximum size: ${maximumSize}`);
1818
core.info(`- Disk root: ${diskRoot}`);
1919

20-
const scriptPath = path.resolve(path.join("scripts", "SetPageFileSize.ps1"));
20+
const scriptPath = path.resolve(__dirname, "..", "scripts", "SetPageFileSize.ps1");
2121
const scriptArguments = [
2222
"-MinimumSize", minimumSize,
2323
"-MaximumSize", maximumSize,
@@ -27,7 +27,7 @@ const run = (): void => {
2727
core.debug(`Script path: ${scriptPath}`);
2828
core.debug(`Script arguments: ${scriptArguments}`);
2929

30-
const scriptResult = child.spawnSync("pwsh", ["-File", scriptPath, ...scriptArguments], {
30+
const scriptResult = child.spawnSync("powershell", [scriptPath, ...scriptArguments], {
3131
timeout: 60 * 1000
3232
});
3333
if (scriptResult.stdout) { core.info(scriptResult.stdout.toString()); }

0 commit comments

Comments
 (0)