Skip to content

Commit

Permalink
Merge pull request #2 from al-cheb/v-malob/fix-script-path
Browse files Browse the repository at this point in the history
Fix script path
  • Loading branch information
maxim-lobanov authored May 6, 2020
2 parents a52e86c + d0cece4 commit 7e23485
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const run = () => {
core.info(`- Minimum size: ${minimumSize}`);
core.info(`- Maximum size: ${maximumSize}`);
core.info(`- Disk root: ${diskRoot}`);
const scriptPath = path.resolve(path.join("scripts", "SetPageFileSize.ps1"));
const scriptPath = path.resolve(__dirname, "..", "scripts", "SetPageFileSize.ps1");
const scriptArguments = [
"-MinimumSize", minimumSize,
"-MaximumSize", maximumSize,
Expand All @@ -193,7 +193,7 @@ const run = () => {
core.debug("Invoke configuration script:");
core.debug(`Script path: ${scriptPath}`);
core.debug(`Script arguments: ${scriptArguments}`);
const scriptResult = child.spawnSync("pwsh", ["-File", scriptPath, ...scriptArguments], {
const scriptResult = child.spawnSync("powershell", [scriptPath, ...scriptArguments], {
timeout: 60 * 1000
});
if (scriptResult.stdout) {
Expand Down
4 changes: 2 additions & 2 deletions src/configure-pagefile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const run = (): void => {
core.info(`- Maximum size: ${maximumSize}`);
core.info(`- Disk root: ${diskRoot}`);

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

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

0 comments on commit 7e23485

Please sign in to comment.