16 March 2017

How to publish your Windows PowerShell script in the PowerShell public gallery

PowerShell Logo
PowerShell is more than just a terminal console. It is developed by Microsoft allowing you to manage their products through command lines or scripts. 

One of the great advantages of belonging to Windows Management Framework (WMF) is that it allows access to:
  • Common Information Model (CMI);
  • Component Object Model (COM);
  • Framework .NET;
  • Server Manager CIM Provider;
  • Server Manager WMI provider;
  • Software Inventory Logging (SIL);
  • Windows Management Infrastructure (WMI);
  • Windows PowerShell;
  • Windows PowerShell Desired State Configuration (DSC);
  • Windows PowerShell Integrated Scripting Environment (ISE);
  • Windows PowerShell Web Services (Management OData IIS Extension);
  • Windows Remote Management (WinRM).

But does it have so many advantages?
Yes, in addition to being able to use the .NET framework you can create scripts to do autonomous jobs that can be executed by parameters, which allows the script to be reusable and updatable.


In PowerShell command lines are called cmdlets and are more complex commands. A cmdlet may even be a script that invokes an API call or other cmdlets. You can see the Cmdlet overview at https://msdn.microsoft.com/pt-br/library/ms714395(v=vs.85).aspx .


It is important to know that new cmdlets or features are only available in the latest versions of the operating system. The latest stable version of WMF is 5.1 which includes:
  • New cmdlets: local users and groups; Get-ComputerInfo;
  • PowerShellGet improvements include enforcing signed modules, and installing JEA modules;
  • PackageManagement added support for Containers, CBS Setup, EXE-based setup, CAB packages;
  • Debugging improvements for DSC and PowerShell classes;
  • Security enhancements including enforcement of catalog-signed modules coming from the Pull Server and when using PowerShellGet cmdlets;
  • Responses to a number of user requests and issues;
WMF Compatibility



WMF 2.0WMF 3.0WMF 4.0WMF 5.0WMF 5.1
Windows XP YesNoNoNoNo
Windows Server 2003YesNoNoNoNo
Windows VistaYesNoNoNoNo
Windows 7 SP1YesYesYesYesYes
Windows Server 2008 SP2Yes
Yes
(Expect IA64)
NoNoNo
Windows Server 2008 R2 SP1Yes
Yes
(Expect IA64)
YesYesYes
Windows 8YesYesYesYesYes
Windows 8.1YesYesYesYesYes
Windows Server 2012 SP1YesYesYesYesYes
Windows Server 2012 R2YesYesYesYesYes
Windows 10YesYesYesYesYes
Windows Server 2016YesYesYesYesYes


As of August 18, 2016 Windows PowerShell became Open-Source which means you can run on MacOS and some Linux distributions. The PowerShell team is using GitHub so anyone can contribute with the project at https://github.com/powershell .

PowerShell Gallery
The PowerShell Gallery is the central repository for PowerShell content. New PowerShell or Desired State Configuration (DSC) commands are present. 

Before you start you must register in https://www.powershellgallery.com/ with a Microsoft account that will be used for publishing.

PowerShell Gallery Login



By accessing your account you can verify that you have an API key and it is this key that is used for submission.
 
PowerShell Gallery - My Account


Script Creation
Before starting the script you need to create the block that includes the script information with the cmdlet 'New-ScriptFileInfo'.  The block will contain the version, GUID that is automatically generated, author, required information and script dependencies.

If you already have a script created add the PSScriptInfo body at the beginning of the script.

cmdlet New-ScriptFileInfo

 
Testing the script
The cmdlet 'Test-ScriptFileInfo' checks the comment block if it has an error it will tell you where it is located or how to fix it.

 
cmdlet Test-ScriptFileInfo


As you can see in the image, no error was displayed and can be sent. The following image has a purposeful error in which a variable is not defined and can not be sent until the error is corrected.



Script publishing
With the tested script you can now publish it to publish you need the API key that you can query in your account.  To publish, use the Publish-Script cmnlet.

Publish-Script -Path <localização do script> -NuGetApiKey <chave API>

An important rule is that the name  of the script must be unique if you try to publish a script with the same ID will return an error and is required to rename the script. 


cmnlet Publish-Script


Manage the script in the gallery
In your Manage My Items account you can manage all submitted modules or scripts. 


You can edit the contents of the script.




The gallery also has the chance to delete the script but is not yet supported by the gallery what it can do is remove the script from the searches.



With successful publishing the script is visible and searchable in the Web Gallery comes as in PowerShell. The gallery hypothesis to save the script without installing with the 'Save-Script' cmldet. If someone wants to install you can use the cmdlet 'Install-Script'.




There is no restriction for publication but you have to be careful that the script or module you want to publish does not contain any sensitive information such as logins, passwords, keys for database links.

Even if the script has passed the tests it is always important to review and test the script before publishing. If it is possible to do it on another machine. 

14 March 2017

Webcast Microsoft Windows Server 2016: the Cloud-ready operating system

On March 16, 2017 you can participate in the Webcast "Microsoft Windows Server 2016: The Cloud-ready operating system" between 16:00 - 18:00 WET through Rumos Live Traning with the trainer Pedro Ferreira Pereira.


This webcast aims to address the Windows Server 2016 news, as well as the course of certification exams to achieve MCSA: Windows Server 2016. 
  • Introduction to exams to achieve MCSA certification: Windows Server 2016.
  • New features of Windows Server 2016.
You can subscribe here: https://www.eventbrite.pt/e/bilhetes-microsoft-windows-server-2016-o-sistema-operativo-cloud-ready-31228289655  .

 The language of the Webcast will be in Portuguese.

Sobre o Webcast 
The Webcast is carried out by the companies of Grupo Rumos , Rumo, Galileu, Flag, Profitecla, Escola Digital Rumos, Escola Professional Braga and Escola Professional Ruiz Costa. 

Cost
It's totally free just have to register in the webcast that Eventbrite is used. You can check the previous events here: https://www.eventbrite.pt/o/rumos-s-a-7582499537?past=1 and view the videos in http://www.livetraining.pt/arquivo.html

Platform 
The webcast uses the Adobe web conferencing platform better known as Adobe Connect and its use is not complicated. You only need to enter the room and take the verification and compatibility test on your computer. To ensure that you can see the video signal and image.


You can ask the speaker all the questions and talk to other participants who are present.



Video and audio quality
It all depends on the speaker's upload. Unfortunately, they do not use a isolated connection for the Webcast. In the last webcast I saw that it was "Be a Game Developer" their upload was so bad that the link was always falling, the voice always failing and it was not possible to follow up with the speaker. Sometimes the speaker did not realize that the voice was not being transmitted and missed a large part of the webcast. 



Even if you can not see the webcast until the end, you will receive an email with  an Internet address that allows you to view the webcast recording, and you may also receive a discount voucher. 

If you want to know more about the webcast of the Grupo Rumos, visit the official web page at www.livetraining.pt.

23 February 2017

Delphi a programming language with 22 years coming to stay.

Today I received an email from Embarcadero it reported that the Delphi programming language not to be confused with the Delphi Automotive, have 22 years is amazing how time goes by. Delphi is a programming language of the 90's developed by Borland which was the successor of the Pascal programming language.

I am not a Delphi professional programmer but it was one of the programming languages I learned to program with. The first programming language I learned/used was Sinclair BASIC from ZX Spectrum the second was Pascal with the IDE Turbo Pascal 7.0 on MS-DOS. Beautiful times of youth ;) .

ZX Spectrum +3 manual
ZX Spectrum +3 manual





One of the programs that I remember doing was the simulation of a parking meter that works 365 days of the year I think I still have the source code on a floppy disk but I don't have floppy reader.

Pascal Book
Besides Pascal I tried Delphi with the Borland Delphi IDE for Windows.  


Delphi is still widely used and maintained because of legacy software in companies. In the company where I work I do the management/administration of an ERP that was developed in Delphi where the data is stored in Firebird SQL. In that some anti-virus software and others report that it was compiled and developed in Microsoft Visual C ++ and the identity of the assembly is CodeGear RAD Studio.

Remains a closed development language. It's not "open" or too used between partners or open-source projects like Java or C #. These two are quite used in the Azure cloud services, AWS and other. There is no cloud services offer for Delphi and Firebird / Interbase databases continues to use virtual machines in the cloud. And for me this is due to the Embarcadero.

After Pascal I went through C, C# and Java. Nowadays I develop some applications for personal use in Java and C#. The last personal project I did was to convert a Java application to C#. Visual Studio is free for personal use I again use the C# programming language.

4 February 2017

Microsoft Azure Machine Learning and HDInsight beta exams

Are you data scientists, analysts, data engineers, data architects or data developers who use Azure cloud services to build and deploy intelligent solutions or big data analytics solutions.

Now you have the opportunity to do two Microsoft exams totally for FREE.

Exam 70-774   : Perform Cloud Data Science with Azure Machine Learning (beta)
Registration    : https://www.microsoft.com/en-us/learning/exam-70-774.aspx Voucher code  : SCPAZ774EP

Exam 70-775   : Perform Data Engineering on Microsoft Azure HDInsight (beta)
Registration    : https://www.microsoft.com/en-us/learning/exam-70-775.aspx
Voucher code  : BPERB775VM

You must register and take the exam by March 31, 2017.

There are a limited amount of spots, so when they're gone, they're gone.

You should also be aware that there are some country limitations where the beta code will not work (e.g., Turkey, Pakistan, India, China, Vietnam); you will not be able to take the beta exam for free in those countries.

To prepare for the beta exam, check out my recent blog for ideas: https://borntolearn.mslearn.net/b/weblog/posts/just-how-does-one-prepare-for-beta-exams-without-preparation-materials.

Also, keep in mind that this exam is in beta, which means that you will not be scored immediately. You will receive your final score and passing status once the exam is live.

28 January 2017

11th meeting of the IT Pro Portugal Community


You are invited to participate in the 11th meeting of the technical community of Portuguese Pro IT professionals.

Is a totally free event, but subject to prior registration in https://itproportugal11.eventbrite.com




Agenda:

18:30 Reception
19:15 "Configuration Management on Azure with Puppet and Chef" - Istvan Cebrian
20:20 "HA/DR Solutions with Windows Server 2016 and SQL Server 2016" - Murilo Miranda
20:50 "Azure Security Center can make you more safe" - Vítor Pombeiro
21:20 Draw and closing

Validate the confirmation on the Facebook.

15 January 2017

You can make Microsoft certifications just for self-study


YES, but it requires a great willpower and great dedication. I'm not saying that the Microsoft Official Courseware (MOC) is useless on the contrary when attending a MOC you have access to training + documentation + laboratories and a trainer that responds to any questions you have and is present to help you.

By self-study you do not have access to any trainer in person but we can count on technical communities, social network and friends to take some questions but may not be immediately available.

I passed the exam 70-70-532 532 and for self-study but I lost many hours of preparation. Despite not attending any MOC had some monetary costs. Nothing is free.

Exam 70-532
In the exam 70-532 I used various methods of preparation Labs, books, videos, several trials of Azure and my notes.

I bought the three books of Azure Exam certification Ref. but with the upgrade in October/November 2016 is not recommend buying them because they're completely out of date.


The practical part is very important can mount a lab on your own computer or on virtual machines what allows practice with Azure services. The exercises of the MOC are available for free at https://www.microsoft.com/en-us/learning/companion-moc.aspx. I used the Azure virtual machines to do the exercises which allow to have the advantage in that could let the machine always on and maintain the State of the exercises and not only.

During 4 months you can make your free labs in Azure I explain how can test the Azure for free in http://blog.pt.rramoscabral.com/p/azure-trial.html.

Also used videos/videos of Pluralsight, CBT Nuggets, AMM, Channel 9 and Ignite. About Pluralsight and CBT Nuggets I used the trial for a week at the same time not just attention is required to cancel the trial before the end of the trial period. Only has the problem of not being able to use CBT Nuggets or Pluralsight in the next certifications. In the case of Pluralsight for a developer tests or 70-534 can get access to the videos during 3 months.

I made my own notes through the book + video + Azure documentation.

I have no problem saying that I failed the first Microsoft exam due to overconfidence. So I had to change the method of self-study and be even more dedicated. There is no glory without sacrifice.
I tried the practice tests from Measureup and heartily recommend. These tests does not include the official exam questions the questions are based on content and each question has the full explanation and links to Microsoft's documentation. This kind of tests is great for testing the level of knowledge.


If you don't want to buy a practical exam can try the free issues available as follows:
•    Demonstration test of Measureup - http://www.measureup.com/
•    Practical test 70-532 from Chris Pietschmann  - https://github.com/crpietschmann/Azure-70-532-Practice-Test
•    Practical test 70-533 from Chris Pietschmann  https://github.com/crpietschmann/Azure-70-533-Practice-Test
•    Demonstration test of Transcender using by CBT Nuggets -https://www.transcender.com/

Don't use Dumps which is a compilation of questions of official examinations. And do not recommend their use for the following reasons:
•    First, you're cheating yourself;
•    Second, it means that you don't understand and we still do not understand that it is an authentic illusion;
•    Third, there is no guarantee that the questions and answers are true or are correct. This at your own risk;
•    Fourth, i did some research there is a lot of people complaining that they lost money and not only. Examples:
o    http://www.ripoffreport.com/r/Certplex-Ltd/London-United-Kingdom-WC1N-3AX/Certplex-Ltd-ExamCollection-Avanset-Fake-Guarantees-and-charging-continuously-monthly-sub-1161364
o    http://lessons-learned-from-life.blogspot.pt/2014/07/examcollection-premium-service-scam.html
•    Fifth, trust yourselves to make a study plan if you can't make a plan first schedule your exam and so has a deadline and an obligation to fulfill. If you think you're not ready you can always reschedule with 24 hours in advance of the date of appointment.
With the change of the method of study I managed to pass the exam. Not all methods work with all people, it is necessary to create our own method of study. The length of time is also not equal for all, I recommend you practice a lot in Azure and use the trials available.

Besides this all now have access to a virtual course Developing Microsoft Azure Solutions in EDX  (https://www.edx.org/course/developing-microsoft-azure-solutions-microsoft-dev233) when I prepared for the exam this Edx course did not yet exist.   


Exam 70-533: Implementing Microsoft Azure Infrastructure Solutions

For this test I used the same method of study but how could no longer use Pluralsight, CBT Nuggets I used the Opsgility. The Opsgility also have a trial but with a difference that includes Labs that we can do in azure and is excellent for certification Azure, Office and Sharepoint. I continued to use the Ignite videos and Channel 9.


I went back to using a virtual machine in the Azure to do my lab so all files, documentation, were a second disc of data for later download. But not everything worked in conditions had some problems and had to redeploy   and change the size to solve some of the problems.

Also I used the practical tests of Measureup and the offline version to be able to test my knowledge without requiring Internet access. The offline version also gives access to online version are 2 for 1.



In the plan of study usually insert all modules and content into a text file. In the following example is a part of the plan with the Opsgility videos. When I view the videos marked with X.



To finish if they wish to do for self study is necessary to have a great dedication can take three months or more but should not give up. When a scan is a joy as great as doing the best Prize in the world. Which means that all the work I had gave thefts if you don't pass don't stay unmotivated I I spent the first I just disappoint doesn't mean you've given up.

There are several groups and communities that can help even the Microsoft Most Valuable Professional (MVP) in which they can help search in https://mvp.microsoft.com/en-us/MvpSearch .   

5 January 2017

Beta Exams Microsoft SQL 767 and 764 require more participants

You are specializes in database administration and Data Warehouse implementation.

Until 31 January 2017 has the chance to make these two exams free betas.

Exam 70-764: Administering a SQL Database Infrastructure (beta)
Marking: https://www.microsoft.com/en-us/learning/exam-70-764.aspx
Voucher: ZTNDFS764CC


Exam 70-767 Implementing the SQL Data Warehouse
Marking: https://www.microsoft.com/en-us/learning/exam-70-767.aspx
Voucher: BVPYHJ767DD


There is a limited amount of seats.
These examinations are beta, which means that is your final score takes time, please be patient!

Source: Microsoft Training and Certification Community