• Home
  • About
    • Building XP photo

      Building XP

      Let's be honest: I have no idea what this is all about. So why not have fun while learning things?

    • Learn More
    • Email
    • Twitter
    • LinkedIn
    • Github
    • Keybase
  • Posts
    • All Posts
    • All Tags
  • Log
    • All Posts

04 Feb. 2019

04 Feb 2019

Reading time ~1 minute

  • Add-Type -AssemblyName doesn’t work in a class declaration: being that the file is loaded in one go and checked for errors before being executed, the assembly is not loaded. Solutions:
    1. A script that loads assembly, then sources the class declarations.
    2. In a module, initialise RequiredAssemblies.
  • [System.Security.Principal.WindowsIdentity]::new($UserName) creates a logon event (type 3) for the user.
  • Nullable types are unsurprinzingly not seen as vanilla types in constructor overloads.
  • DNS TXT records do not follow CNames.


PowershellclassAssembly Share Tweet +1