Please feel free to provide feedback or file bugs here.

high CPU

Found out when my CPU is high (99%-100) (i do set executionpolicy to remotesign/unrestricted also)
When i run the PS script, it will ask for executionpolicy.
but when i low CPU, it will just run the script.

suspect value (executionpolicy remotesign) unable to pass thru to script.ps1 on time. so it prompt out everytime when CPU is high.
do we have some setting to tune this. delay it, so that executionpolicy have more time to pass the value to script.ps1.

---------------------------------
Script:
$sourcefolder="D:\A743"
$datenow = get-date
$processdate = (get-date).Adddays(-3)

get-childitem $sourcefolder -file | where-object { $_.lastwritetime -le $processdate } | remove-item -force
---------------------------------------
WIN2012R2 PowerShell v5.1
--------------------------------------
this is the message cause the automation fail.

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust.
Changing the execution policy might expose you to the security risks described
in the about_Execution_Policies help topic. Do you want to change the execution
policy?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):

Thanks you. due to the original post cant update. here i post again for all the information. Thanks

LOW CPU = all run normal. no prompt anything abt execution policy.
high CPU = will ask exceution policy. if automation (without GUI) will fail.

1 vote
Sign in
(thinking…)
Password icon
Signed in as (Sign out)

We’ll send you updates on this idea

cK shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...
  • cK commented  ·   ·  Flag as inappropriate

    i found got a way can run when CPU is high.
    i convert it to exe file. and it able to run when CPU high. no prompt for execution policy.
    for run script ps1,i still wondering why CPU high 100%, ti will prompt the execution policy.

Feedback and Knowledge Base