• /r/powershell
  • PowerShell 5: Can you ‘export’ a class definition from an EngineEvent into the current session scope?

    Hello! I am playing with classes and events in Powershell 5 and trying to get a class definition exported from an event being triggered into the current scope. For example would something like this be possible? C:pathtoRandomClass.ps1 contents: Class SomeClass{ [string]$Property SomeClass([string]$Prop){ $this.Property = $Prop } } Event Registration: Register-EngineEvent -SourceIdentifier “ClassDeclarationFile” -Action { . […]

  • /r/powershell
  • bcp errors

    I’m trying to import data into a SQL table using BCP in a Powershell script, but I’m getting an error and don’t understand why. The error is Username not provided, either use -U to provide the user name or use -T for Trusted Connection Windows Authentication is not an option. Here is the code: $server […]

  • /r/azure
  • ASM and ARM Powershell

    Hi guys. Im having an issue I have Classic VMs and other Cloud services but I manage them using new ARM portal, so I can see they are arranged in Resource groups. The thing is when I try to use ARM Powershell cmdlets, I get nothing. For example I login to the account using the […]

  • /r/powershell
  • Help with member of script

    So i am trying to pull from a list of users and get their group memberships. It’s taken me some time to get what i have but it works except for the part of the csv export that instead of having the username of the user it has everything from the the user csv (name,Samaccount,DN,email) […]