{"id":313,"date":"2018-01-24T21:31:22","date_gmt":"2018-01-25T03:31:22","guid":{"rendered":"http:\/\/draith.com\/?p=313"},"modified":"2018-01-24T21:31:22","modified_gmt":"2018-01-25T03:31:22","slug":"powershell-get-is-optional","status":"publish","type":"post","link":"https:\/\/draith.com\/?p=313","title":{"rendered":"PowerShell &#8211; Get is optional"},"content":{"rendered":"<p>Here is something I learned a while back from Mr. Snover himself, and it was something I just couldn&#8217;t believe.  Sure enough it&#8217;s true, and it&#8217;s still true in PowerShell Core 6.  The &#8220;Get-&#8221; part of almost all &#8220;Get-&#8221; commands is completely optional.  Yeah &#8211; you heard that right.  &#8220;Get&#8221; is optional for almost all.  Get-Process can&#8217;t run correctly, mainly because &#8220;Process&#8221; expects some arguments.  Otherwise, give it a try!<\/p>\n<pre class=\"lang:ps decode:true \" >PS  C:\\Blog (9:24:23 PM) &gt; timezone\n\n\nId                         : Central Standard Time\nDisplayName                : (UTC-06:00) Central Time (US &amp; Canada)\nStandardName               : Central Standard Time\nDaylightName               : Central Daylight Time\nBaseUtcOffset              : -06:00:00\nSupportsDaylightSavingTime : True\n<\/pre>\n<pre class=\"lang:ps decode:true \" >PS  C:\\Blog (9:24:27 PM) &gt; random\n1240576702<\/pre>\n<pre class=\"lang:ps decode:true \" >PS  C:\\Blog (9:25:18 PM) &gt; computerinfo\n\n\nWindowsBuildLabEx                                       : 16299.15.amd64fre.rs3_release.170928-1534\nWindowsCurrentVersion                                   : 6.3\nWindowsEditionId                                        : EnterpriseN\nWindowsInstallationType                                 : Client\nWindowsInstallDateFromRegistry                          : 12\/7\/2017 10:29:37 AM\nWindowsProductId                                        : 00330-00180-00000-AA567\nWindowsProductName                                      : Windows 10 Enterprise N\nWindowsRegisteredOrganization                           :\nWindowsRegisteredOwner                                  : Draith\nWindowsSystemRoot                                       : C:\\WINDOWS\nWindowsVersion                                          : 1709\nWindowsUBR                                              : 192\nBiosCharacteristics                                     : {7, 11, 12, 15...}\nBiosBIOSVersion                                         : {ALASKA - 1072009, V1.12, American Megatrends - 4028F}\nBiosBuildNumber                                         :\nBiosCaption                                             : V1.12\nBiosCodeSet                                             :\nBiosCurrentLanguage                                     : en|US|iso8859-1\nBiosDescription                                         : V1.12\nBiosEmbeddedControllerMajorVersion                      : 255\nBiosEmbeddedControllerMinorVersion                      : 255\nBiosFirmwareType                                        : Uefi\nBiosIdentificationCode                                  :\nBiosInstallableLanguages                                : 1\nBiosInstallDate                                         :\nBiosLanguageEdition                                     :\nBiosListOfLanguages                                     : {en|US|iso8859-1}\nBiosManufacturer                                        : American Megatrends Inc.\nBiosName                                                : V1.12\nBiosOtherTargetOS                                       :\nBiosPrimaryBIOS                                         : True\nBiosReleaseDate                                         : 8\/10\/2015 7:00:00 PM\nBiosSerialNumber                                        : To be filled by O.E.M.\nBiosSMBIOSBIOSVersion                                   : V1.12\nBiosSMBIOSMajorVersion                                  : 2\nBiosSMBIOSMinorVersion                                  : 8\nBiosSMBIOSPresent                                       : True\nBiosSoftwareElementState                                : Running\nBiosStatus                                              : OK\nBiosSystemBiosMajorVersion                              : 4\nBiosSystemBiosMinorVersion                              : 6\nBiosTargetOperatingSystem                               : 0\nBiosVersion                                             : ALASKA - 1072009\nCsAdminPasswordStatus                                   : Disabled\nCsAutomaticManagedPagefile                              : True\nCsAutomaticResetBootOption                              : True\nCsAutomaticResetCapability                              : True\nCsBootOptionOnLimit                                     :\nCsBootOptionOnWatchDog                                  :\nCsBootROMSupported                                      : True\nCsBootStatus                                            : {0, 0, 0, 0...}\nCsBootupState                                           : Normal boot\nCsCaption                                               : DESKTOP-KL1CDTP\nCsChassisBootupState                                    : Safe\nCsChassisSKUNumber                                      : To be filled by O.E.M.\nCsCurrentTimeZone                                       : -360\nCsDaylightInEffect                                      : False\nCsDescription                                           : AT\/AT COMPATIBLE\nCsDNSHostName                                           : <<Data Redacted>>\nCsDomain                                                : WORKGROUP\nCsDomainRole                                            : StandaloneWorkstation\nCsEnableDaylightSavingsTime                             : True\nCsFrontPanelResetStatus                                 : Disabled\nCsHypervisorPresent                                     : True\nCsInfraredSupported                                     : False\nCsInitialLoadInfo                                       :\nCsInstallDate                                           :\nCsKeyboardPasswordStatus                                : Disabled\nCsLastLoadInfo                                          :\nCsManufacturer                                          : MSI\nCsModel                                                 : MS-7917\nCsName                                                  : <<Data Redacted>>\nCsNetworkAdapters                                       : {Ethernet 2, Ethernet, vEthernet (Default Switch), vEthernet\n                                                          (ExternalSwitch)...}\nCsNetworkServerModeEnabled                              : True\nCsNumberOfLogicalProcessors                             : 8\nCsNumberOfProcessors                                    : 1\nCsProcessors                                            : {Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz}\nCsOEMStringArray                                        : {To Be Filled By O.E.M.}\nCsPartOfDomain                                          : False\nCsPauseAfterReset                                       : -1\nCsPCSystemType                                          : Desktop\nCsPCSystemTypeEx                                        : Desktop\nCsPowerManagementCapabilities                           :\nCsPowerManagementSupported                              :\nCsPowerOnPasswordStatus                                 : Disabled\nCsPowerState                                            : Unknown\nCsPowerSupplyState                                      : Safe\nCsPrimaryOwnerContact                                   :\nCsPrimaryOwnerName                                      : Draith\nCsResetCapability                                       : Other\nCsResetCount                                            : -1\nCsResetLimit                                            : -1\nCsRoles                                                 : {LM_Workstation, LM_Server, NT}\nCsStatus                                                : OK\nCsSupportContactDescription                             :\nCsSystemFamily                                          : To be filled by O.E.M.\nCsSystemSKUNumber                                       : To be filled by O.E.M.\nCsSystemType                                            : x64-based PC\nCsThermalState                                          : Safe\nCsTotalPhysicalMemory                                   : 34305863680\nCsPhysicallyInstalledMemory                             : 33554432\nCsUserName                                              : <<Data Redacted>>\\Draith\nCsWakeUpType                                            : PowerSwitch\nCsWorkgroup                                             : WORKGROUP\nOsName                                                  : Microsoft Windows 10 Enterprise N\nOsType                                                  : WINNT\nOsOperatingSystemSKU                                    : WindowsEnterprise\nOsVersion                                               : 10.0.16299\nOsCSDVersion                                            :\nOsBuildNumber                                           : 16299\nOsHotFixes                                              : {KB4048951, KB4053577, KB4054022, KB4055237...}\nOsBootDevice                                            : \\Device\\HarddiskVolume2\nOsSystemDevice                                          : \\Device\\HarddiskVolume4\nOsSystemDirectory                                       : C:\\WINDOWS\\system32\nOsSystemDrive                                           : C:\nOsWindowsDirectory                                      : C:\\WINDOWS\nOsCountryCode                                           : 1\nOsCurrentTimeZone                                       : -360\nOsLocaleID                                              : 0409\nOsLocale                                                : en-US\nOsLocalDateTime                                         : 1\/24\/2018 9:25:52 PM\nOsLastBootUpTime                                        : 1\/20\/2018 4:14:27 PM\nOsUptime                                                : 4.05:11:25.3101843\nOsBuildType                                             : Multiprocessor Free\nOsCodeSet                                               : 1252\nOsDataExecutionPreventionAvailable                      : True\nOsDataExecutionPrevention32BitApplications              : True\nOsDataExecutionPreventionDrivers                        : True\nOsDataExecutionPreventionSupportPolicy                  : OptIn\nOsDebug                                                 : False\nOsDistributed                                           : False\nOsEncryptionLevel                                       : 256\nOsForegroundApplicationBoost                            : Maximum\nOsTotalVisibleMemorySize                                : 33501820\nOsFreePhysicalMemory                                    : 22288576\nOsTotalVirtualMemorySize                                : 38482556\nOsFreeVirtualMemory                                     : 25010532\nOsInUseVirtualMemory                                    : 13472024\nOsTotalSwapSpaceSize                                    :\nOsSizeStoredInPagingFiles                               : 4980736\nOsFreeSpaceInPagingFiles                                : 4980736\nOsPagingFiles                                           : {C:\\pagefile.sys}\nOsHardwareAbstractionLayer                              : 10.0.16299.192\nOsInstallDate                                           : 12\/7\/2017 4:29:37 AM\nOsManufacturer                                          : Microsoft Corporation\nOsMaxNumberOfProcesses                                  : 4294967295\nOsMaxProcessMemorySize                                  : 137438953344\nOsMuiLanguages                                          : {en-US}\nOsNumberOfLicensedUsers                                 :\nOsNumberOfProcesses                                     : 194\nOsNumberOfUsers                                         : 2\nOsOrganization                                          :\nOsArchitecture                                          : 64-bit\nOsLanguage                                              : en-US\nOsProductSuites                                         : {TerminalServicesSingleSession}\nOsOtherTypeDescription                                  :\nOsPAEEnabled                                            :\nOsPortableOperatingSystem                               : False\nOsPrimary                                               : True\nOsProductType                                           : WorkStation\nOsRegisteredUser                                        : Draith\nOsSerialNumber                                          : 00330-00180-00000-AA567\nOsServicePackMajorVersion                               : 0\nOsServicePackMinorVersion                               : 0\nOsStatus                                                : OK\nOsSuites                                                : {TerminalServices, TerminalServicesSingleSession}\nOsServerLevel                                           :\nKeyboardLayout                                          : en-US\nTimeZone                                                : (UTC-06:00) Central Time (US &amp; Canada)\nLogonServer                                             : \\\\<<Data Redacted>>\nPowerPlatformRole                                       : Desktop\nHyperVisorPresent                                       : True\nHyperVRequirementDataExecutionPreventionAvailable       :\nHyperVRequirementSecondLevelAddressTranslation          :\nHyperVRequirementVirtualizationFirmwareEnabled          :\nHyperVRequirementVMMonitorModeExtensions                :\nDeviceGuardSmartStatus                                  : Running\nDeviceGuardRequiredSecurityProperties                   : {0}\nDeviceGuardAvailableSecurityProperties                  : {BaseVirtualizationSupport, DMAProtection}\nDeviceGuardSecurityServicesConfigured                   : {0}\nDeviceGuardSecurityServicesRunning                      : {0}\nDeviceGuardCodeIntegrityPolicyEnforcementStatus         : Off\nDeviceGuardUserModeCodeIntegrityPolicyEnforcementStatus : Off\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is something I learned a while back from Mr. Snover himself, and it was something I just couldn&#8217;t believe. Sure enough it&#8217;s true, and it&#8217;s still true in PowerShell Core 6. The &#8220;Get-&#8221; part of almost all &#8220;Get-&#8221; commands is completely optional. Yeah &#8211; you heard that right. &#8220;Get&#8221; is optional for almost all. &hellip; <a href=\"https:\/\/draith.com\/?p=313\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;PowerShell &#8211; Get is optional&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[16],"class_list":["post-313","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-powershell"],"_links":{"self":[{"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts\/313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=313"}],"version-history":[{"count":0,"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts\/313\/revisions"}],"wp:attachment":[{"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}