{"id":26319468,"url":"https://github.com/sassdawe/no-admin-powershell","last_synced_at":"2026-03-09T17:13:19.028Z","repository":{"id":37423056,"uuid":"505569461","full_name":"sassdawe/no-admin-powershell","owner":"sassdawe","description":"⭐ Tips and tricks for when you don't have local admin rights 💜","archived":false,"fork":false,"pushed_at":"2022-09-13T05:55:34.000Z","size":22,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-02T02:37:38.404Z","etag":null,"topics":["no-admin-rights","powershell","psconfeu"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sassdawe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["sassdawe"],"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["www.buymeacoffee.com/sassdawe"]}},"created_at":"2022-06-20T19:17:57.000Z","updated_at":"2023-07-13T21:56:47.000Z","dependencies_parsed_at":"2023-01-17T14:24:15.417Z","dependency_job_id":null,"html_url":"https://github.com/sassdawe/no-admin-powershell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassdawe%2Fno-admin-powershell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassdawe%2Fno-admin-powershell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassdawe%2Fno-admin-powershell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassdawe%2Fno-admin-powershell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sassdawe","download_url":"https://codeload.github.com/sassdawe/no-admin-powershell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243746230,"owners_count":20341204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["no-admin-rights","powershell","psconfeu"],"created_at":"2025-03-15T15:19:10.424Z","updated_at":"2026-03-09T17:13:18.935Z","avatar_url":"https://github.com/sassdawe.png","language":null,"funding_links":["https://github.com/sponsors/sassdawe","www.buymeacoffee.com/sassdawe"],"categories":[],"sub_categories":[],"readme":"# no-admin-powershell\n\n\u003e Security people read this first: [For-Security-People](./For-Security-People.md)\n\n## Tips and tricks for when we don't have local admin rights \n\n![image](https://user-images.githubusercontent.com/10754765/174748062-d4310117-eca8-4bc4-bd2e-2ba1aea7f7de.png)\n\n\u003e First presented at [PowerShell Conference Europe 2022](https://psconf.eu)\n\n## Opening PowerShell\n\nWhen we are on Windows we don't need to install anything to get it started.\nJust search for/type `ISE` into the Start menu to find `Windows PowerShell ISE`.\nISE stands for Integrated Scripting Environment\n\n![image](https://user-images.githubusercontent.com/10754765/174759850-97ef421f-452c-42a1-910d-027c84bd54d4.png)\n\n**ISE is perfectly enough!**\n\n## Protect ourselves!\n\nWhen we experiment in `ISE` we could run stuff accidentally and that could be bad. \n\n`ISE` has two really great buttons:\n\n- Run Script (shortcut `F5`)\n- Run Selection, or current line (shortcut `F8`)\n\n![image](https://user-images.githubusercontent.com/10754765/178137112-b439422c-7ec3-484e-806a-1d66c78c826f.png)\n\nTime to time we will end up with lots of things in our file, and accidentally executing everything could be bad.\n\n**Solution:** add `throw 'no no'` to the first line and by doing this the current script cannot be executed anymore as a whole:\n\n![image](https://user-images.githubusercontent.com/10754765/178137247-0f6f9138-e72a-4d47-ac14-b9823ce791ee.png)\n\n## Profile file\n\nThe **Profile file** is really great because it enables us to customize our PowerShell console in a persistent way. \n\n\u003e **Note:** Most things we can do in PowerShell will be related to the current process, the current PowerShell session. When we close the window they will get lost. So to get persist things we can use the profile file.  \n\nThe `$profile` file will get executed every time when we start PowerShell, so this is where we can store our 'things'. (But this file does not exists by default, so we need to create it.)\n\n```PowerShell\nWrite-Host $profile\n\nTest-Path $profile\n\nNew-Item $profile -ItemType File\n\nNew-Item $profile -ItemType File -Force\n```\n\nLet's try it!\n\n## Execution Policy\n\nExecution policy in PowerShell is like something eveyone runs into and turns off...\n\n```PowerShell\nGet-ExecutionPolicy\n\nSet-ExecutionPolicy -ExecutionPolicy RemoteSigned\n\n# Try scoping it to us\n\nSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\n\n# if RemoteSigned does not work, just use Bypass\n\nSet-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser\n\n```\n\n\u003e **NOTE** the use of `-Scope CurrentUser`\n\n## Error message color\n\nAs others have already said it, color red is bad, so let's use something nicer \n\n```PowerShell\n$host.PrivateData.ErrorForegroundColor = 'Green'\n\n# and try it\n1/0\n```\n\nAlso, save this into our profile, because this is not a persistent setting.\n\n## PowerShell Gallery\n\nThe PowerShell Gallery is from where we can get the goodies, like QR code generator\n\n```PowerShell\nFind-Module QRCodeGenerator\nFind-Module QR*\n\nInstall-Module QRCodeGenerator\n\nInstall-Module QRCodeGenerator -Scope CurrentUser\n\nNew-QRCodeURI https://github.com/sassdawe/no-admin-powershell -Show \n```\n\n\u003e **NOTE** the use of `-Scope CurrentUser`\n\n## Help system\n\nPowerShell has the most awesome extensible help system\n\n```PowerShell\nGet-Help\n```\n\nBut sadly by default it comes empty, and we need to download the help **with admin rights** so here we need to ask help from our - hopefully - friendly neighbourhood IT admin, or help desk person to run this command as a local admin on our machine\n\n```PowerShell\nUpdate-Help -Force -ErrorAction SilentlyContinue\n```\n\nSo we can use `Get-Help` without any errors.\n\n## Important commands\n\n```PowerShell\nGet-Help\n\nGet-Member\n\nGet-Command\n\nGet-Command Get-*\n\nGet-Command Set-*\n\nGet-Command *-Computer\n```\n\n## Also add these to our profile\n\n```PowerShell\n$ProgressPreference = 'SilentlyContinue'\n$PSDefaultParameterValues[\"Install-Module:Scope\"] = \"CurrentUser\"\n```\n\n## TO-DO: Add more stuff\n\nAdd more things later.\n\nFeel free to submit pull request with your goodies!\n\n## Credit\n\nInfluenced by **Mike F Robbins**\n\n[http://mikefrobbins.com](http://mikefrobbins.com)\n\n[PowerShell 101: The No-Nonsense Beginner’s Guide to PowerShell](https://github.com/mikefrobbins/Presentations/blob/main/PowerShell%20on%20the%20River%202019/PowerShell%20101/PowerShell%20101.ps1)\n\nAnd also by **Chrissy LeMaire**'s [Tweet](https://twitter.com/cl/status/1446446992633237508)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassdawe%2Fno-admin-powershell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsassdawe%2Fno-admin-powershell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassdawe%2Fno-admin-powershell/lists"}