View ConvertTo-LocalTime.ps1
class DateTransformAttribute : System.Management.Automation.ArgumentTransformationAttribute { | |
# property to take additional format strings for transformations | |
[string[]]$AdditionalFormatStrings | |
# default constructor: | |
DateTransformAttribute() : base() { } | |
# 2nd constructor with parameter AdditionalFormatStrings | |
DateTransformAttribute([string[]]$AdditionalFormatStrings) : base() { |
View customArgumenTransformationAttribute_DateTime_example.ps1
# define a format that is supported by our attribute | |
$stringDate = '4/14 4:12PM' | |
# try it first with the normal datetime type | |
[datetime]'4/14 4:12PM' | |
# this threw an error | |
# define a variable that utilizes the attribute | |
[datetime][DateTransform()]$dt = $stringDate | |
# no error | |
$dt |
View customArgumenTransformationAttribute_DateTime.ps1
class DateTransformAttribute : System.Management.Automation.ArgumentTransformationAttribute { | |
# property to take additional format strings for transformations | |
[string[]]$AdditionalFormatStrings | |
# default constructor: | |
DateTransformAttribute() : base() { } | |
# 2nd constructor with parameter AdditionalFormatStrings | |
DateTransformAttribute([string[]]$AdditionalFormatStrings) : base() { |
View parseExact.ps1
[datetime]::ParseExact('08|12|2009 4:33 PM','dd|MM|yyyy h:m tt',$Null) | |
#returns Tuesday, December 8, 2009 4:33:00 PM on an English system |
View test.ps1
Param( | |
[Parameter(Mandatory)] | |
[ArgumentCompleter( | |
{ | |
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) | |
$allTimezones = Get-TimeZone -ListAvailable | Group-Object DisplayName -AsHashTable -AsString | |
$allTimezones.GetEnumerator() | Where-Object { $_.Name -like "*${wordToComplete}*" } | | |
Sort-Object { $_.Value.Displayname }-Unique | ForEach-Object { | |
New-Object System.Management.Automation.CompletionResult ( | |
"'$($_.Value.Id)'", |
View complex numbers.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View algebra2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Matrix visualization.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View graphs and plots.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Refactoring polynomials.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder