To encode a Unicode character in a PowerShell string, prefix the hex value of the unicode with 0x and then cast it to System.Char: PS > [char]0x263a . Using PowerShell Parameter Validation to Make Your Day Easier How to write Powershell modules with classes - Stephanevg In Windows PowerShell, a string can be numbers, words or characters. Live Demo Problem and Solution. It will load any class, Enum and exported function into the current session. Example Code. I'll continue to use the Set-ExecutionPolicy cmdlet as my example, but these will work for any class that is an enum. Introducing PSReflect -a series of helper functions designed to make defining in-memory enums, structs, and Win32 functions extremely easy. While PowerShell does it's best to present it as a readable string to us in the console, an enum is actually a data structure of its own. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. The problem is that the isDefined method isn't terribly useful.. You need to use another getValues method, which returns the set of member values from the enum type. Enum like switch parameter in PowerShell How to convert an enum type variable to a string in C++? As the normal powershell -eq operator is designed to perform case insensitive comparison, you may need to enforce case-sensitive string compare in some cases, for this case you can use the operator -ceq which compare two string values with case sensitive check. Out-string is useful when you need to manipulate the string before sending to file. The format strings available can be found here.. yyyy: Year; MM: Month; dd: Day; HH: Hour (HH for 24 hours format and hh for 12 hours format); mm: Minute; ss: Seconde