Its frequently said that PowerShell is so big that no one can know everything about it. I proved that today when I ādiscoveredā a change in PowerShell of which I wasnāt aware.
If you create an array:
Ā£> $a = 1,2,3
You can then get the number of members of that array i.e. its length
In PowerShell 1.0 and 2.0 if you tried that on a variable that only held a single value you would get an error when you tried to access the first value:
Ā£> $b = 1
The count property returns nothing
Unable to index into an object of type System.Int32.
At line:1 char:4
+ $b[ <<<< 0]
+ CategoryInfo : InvalidOperation: (0:Int32) , RuntimeException
+ FullyQualifiedErrorId : CannotIndex
This changed in PowerShell 3.0 and later
Ā£> $b = 1
You can even try other indices
And just get nothing back rather than an error.
This is really useful as you can now safely test on the Count property and if the value is greater than 1 to determine if its a collection. Alternatively always treat it as a collection and iterate over the number of elements. I can see this simplifying things for me in quite a few situations
Iāve used Split-Path and its associated cmdlet Join-Path a lot when working with file system paths. Something I read today started me asking if it would work with URLs
Ā£> Split-Path -Path ‘http://powershell.org/wp/forums/forum/windows-powershell-qa/’ -Leaf
Ā£> Split-Path -Path ‘http://powershell.org/wp/forums/forum/windows-powershell-qa/’ -Parent
Ā£> Split-Path -Path ‘http://powershell.org/wp/forums/forum/windows-powershell-qa/’ -NoQualifier
Ā£> Split-Path -Path ‘http://powershell.org/wp/forums/forum/windows-powershell-qa/’ -Qualifier
The āResolve parameter wonāt work because its not a file system path but if you need to play with URLs then could be useful.
Just for completeness Join-Path wonāt work with URLs because its attempting to resolve the file path
Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 1520) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537
But at the same time the new UA causes some interesting problems too. An example is below, as recognized by a popular browser detection website:
For instance, if a website has mobile platform specific UI rendering logic (say, one that renders pages for native UX, visual cues, etc.), the new UA could cause confusion and make the browser detection logic become even more complex. Not only that, it could also skew the web analytics aspects of websites by accounting Windows Phone as either iOS or Android unless the analytics engines takes care of the new UA. So, if someone heavily relies on user-agent any important logic, be prepared to tweak your logic.
+ Firseria + InstallMonetizer
+ OutBrowse ++ VaccineCore ++ Win32.MailPassViewer
++ Win32.Kolab.blrt ++ Win32.Ramnit.A
Total: 2599824 fingerprints in 809788 rules for 7308 products
Iām an ex-pat Brit living in Canada, and there is a very good chance that my first language will be English. Canada uses English UK spelling for many words, so the obvious choice for a keyboard language is English (Canada), and if I go to keyboard settings, English (Canada) is the ONLY language in the list.
The Notification Area tells another story. If I click on the āENGā, I get a choice of TWO languages, and traditionally, the ENG has only exited if there was a choice of more than one language in the list. As I have already explained, I donāt have two in my list, but I can get rid of the ENG by adding English US to the list and then removing it. This works for the session, but appears on a reboot..
Aha, this is Windows 8.1, and the language bar isnāt a toolbar anymore, and neither is it a Notification Area icon, so there has to be something else putting it there, and here it is..
The language toolbar has joined the ranks of the clock, volume and network icons, probably should always have been in that group, but it wasnāt and I have wasted an hour in the last two days trying to see it off. Even little changes like this can turn into a real annoyance, and as far as I am aware, this blog post is the only location on the Internet where you can find out that the Windows 8.1 language ābarā is not a bar at all..
This tutorial will show you how to enable or disable Windows Media Player from automatically checking for updates periodically and the “Automatic updates” options for all users.
This tutorial will show you how to change how often Windows Media Player automatically checks for updates in only your user account in Windows.
This tutorial will show you how to manually check for updates in Windows Media Player.
QUOTE: Targeted attacks are designed to circumvent existing policies and solutions within the target network, thus making their detection a big challenge. As we’ve stressed in our previous entry about common misconceptions about targeted attacks, there is no one-size-fits-all solution against it; enterprises need to arm themselves with protection that can provide sensors where needed, as well as IT personnel equipped enough to recognize anomalies within the network and to act accordingly.
1. Check for Injected DNS Records
2. Audit Accounts for Failed/Irregular Logins
3. Review Security Warning messages and logs
4. Check for Strange Large Files
5. Audit Network Log for Abnormal Connections
6. Abnormal Protocols
7. Increased Email Activity and Spikes
QUOTE: Traditionally, providing security has been primarily a task of the state, but who should be responsible for safeguarding cyberspace? Who will build trust in it? Most of digital infrastructure is owned and operated by the private sector. Moreover, the majority of actors operating in the field of cybersecurity are private. The state has unique capabilities to provide security and maintain trust among people, for example, by mobilizing its unique resources and by passing and enforcing laws.
Trust is an important ingredient of security. Doubt leads to insecurity, whereas trust builds security. When there is no certainty, people seek additional security measures. In cyberspace, these measures usually refer to technical solutions to particular problems. In other words, security is produced through technology. However, addressing the question of trust this way is only part of the solution. Regulationāstandards, laws, treaties, and good practicesāthat establishes rules of the game for cyberspace is also important. Yet the biggest challenge remains in people’s unawareness and lack of familiarity with digital technology.
It is the shared responsibility of all online actors to reinforce trust in the digital world. Thus it lies on everyone’s shoulders to strengthen cybersecurity. The state does its part by establishing national and international regulation and administrative structures needed for cooperation. It strengthens public-private partnerships and allocates powers both upward and downward to different actors. It strives to normalize people’s relationship to cyberspace and educates them to become smart e-citizens, shares information, provides services online, and counteracts threats in the digital world. It also uses market mechanisms, for example, purchasing power and the creation of incentives for companies, other organizations, and individuals to invest in cybersecurity