0% found this document useful (0 votes)
7 views8 pages

PowerShell Module and Registry Access Guide

This document discusses PowerShell modules and accessing the Windows registry using PowerShell. It provides information on creating and importing modules using the .psm1 file extension and Import-Module cmdlet. It also outlines how to access the registry like a drive using the Registry PSProvider and core cmdlets like Get-Item, Get-ChildItem, and Get-ItemProperty. Additional cmdlets for editing registry values are also listed. Exercises are provided to work with modules and access interesting registry keys.

Uploaded by

kaiba_magic07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views8 pages

PowerShell Module and Registry Access Guide

This document discusses PowerShell modules and accessing the Windows registry using PowerShell. It provides information on creating and importing modules using the .psm1 file extension and Import-Module cmdlet. It also outlines how to access the registry like a drive using the Registry PSProvider and core cmdlets like Get-Item, Get-ChildItem, and Get-ItemProperty. Additional cmdlets for editing registry values are also listed. Exercises are provided to work with modules and access interesting registry keys.

Uploaded by

kaiba_magic07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Modules)

•  A)script)with)extension).psm1,)great)for)code)
reuse.)
•  Use)Get7Module1–ListAvailable1to)list)all)
available)modules.)
•  Use)Import7Module)to)import)a)module)
Import_Module1<modulename>1
Import_Module1<modulepath>1
1

26)
Modules)
•  You)can)create)a)module)just)by)renaming)
your)script)to).psm1)
1copy1.\script_ex.ps11.\module_ex.psm11
•  You)can)also)control)what)to)expose)in)a)
module)using)Export7ModuleMember.1
•  We)will)not)touch)Module)manifest)and)
related)things.)

27)
Exercise)5)
•  Try)to)import)a)module.)
•  Can)you)import)a)[Link])[Link])or)cmdlet)
from)a)module?)
•  Write)a)module)which)gets)last)modified)date)
of)file.)

28)
Registry)Access)with)PowerShell)
•  Registry)could)be)accessed)as)drive)due)to)
Registry)psprovider.)
)Get7PSProvider1–PSProvider1Registry1
•  HKLM)and)HKCU)are)available)by)default)while)
other)hives)could)be)accessed)using)other)
ways.)
•  Very)easy)and)powerful)way)to)access)the)
Registry.)
Registry)Access)with)PowerShell)
•  Three)core)cmdlets#)used)to)access)registry:)
–  Get7Item1
–  Get7ChildItem1
–  Get7ItemProperty1
•  Use)Get7Item)to)get)details)(list)of)[Link]))of)the)
registry)key.)
•  Use)Get7ChildItem1to)list)sub7keys)of)a)key.)Use)the))
17Recurse1parameter)to)list)recursively.)
•  Use)Get7ItemProperty)to)view)values)of)registry)keys.)
)
1
Registry)Access)with)PowerShell)
•  To)edit/create/rename)values)in)registry:)
–  Set7Item1
–  Set7ItemProperty1
–  New7Item1
–  Rename7Item1
–  New7ItemProperty1
–  Rename7Itemproperty1
)
1
Registry)Access)with)PowerShell)
•  Accessing)other)Registry)hives)
•  By)using)the)New7PSDrive)cmdlet)we)can)
create))new)PSDrives))
1New7PSDrive17Name1<nameofpsdrive>1117
PSProvider1Registry17Root1Registry::HKEY_USERS1
•  By)sexng)the)[Link])to)Registry)ROOT)
)Set7Loca.on1Registry::1
1We)can)now)use)the)core)cmdlets)to)access)the)
registry)keys.)
)
1
Exercise)6)
•  Find)all)currently)and)recently)logged)on)users)
on)a)machine.)
•  Get)browsing)history)(typed)urls))from)
Internet)Explorer.)
•  Can)you)think)of)five)[Link])Registry)Keys)
which)could)be)useful)in)Pen)Tests.)
•  Set)[Link])as)debugger)for)[Link])and)
[Link])in)Registry.)

33)

You might also like