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 { . […]

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 […]

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 […]