none
Powershell to customize start menu RRS feed

  • Question

  • I have read several different articles on how to do this. I used this ... 

    I found a link that shows me how to do it (unfortunately I'm to new to submit links)

    Here's the script I've come up with

     

    Set-ExecutionPolicy Unrestricted -force
    import-startlayout -layoutpath c:\customstartscreenlayout.bin -mountpath %systemdrive%\


    But I can't get the script  to run. I am a domain admin. I am running powershell ISE as an admin. Here's what I get 

    PS C:\Windows\system32> C:\Users\myusername\Desktop\powershell\myscriptname.ps1
    File C:\Users\myusername\Desktop\powershell\myscriptname.ps1 cannot be loaded because running scripts is disabled on this system. For more 
    information, see about_Execution_Policies at "link to M$ site about policies" LinkID=135170.
        + CategoryInfo          : SecurityError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : UnauthorizedAccess

    I've got the customstartscreenlayout.bin in c:\ 

    I don't really want to do a group policy and I've seen some other ways of doing this but the above seems to be the best for my environment.

     This is my first Powershell attempt :) 

    • Moved by Bill_Stewart Monday, April 30, 2018 9:14 PM This is not "teach me PowerShell basics step by step" forum
    Monday, February 19, 2018 6:14 PM

All replies

  • You cannot use batch variables in PowerShell.  Use Ps environment variables:

    %systemdrive% ==>> $env:SYSTEMDRIVE

    dir env:

    If Group Policy is restricting script execution then you cannot change it in a command.

    Get-ExecutionPolicy -List

    You need to start by learning PowerShell before you attempt things.  Don't waste your time guessing.

    Learn PowerShell  


    \_(ツ)_/

    Monday, February 19, 2018 6:25 PM