ClassicPress Development with GitHub: Delete Repository

GitHubWhen I started developing plugins for ClassicPress I decided that I needed to be using source control. As ClassicPress is intending to use GitHub for their plugin directory, it made sense for me to use it as well. This post is part of a series on ClassicPress Development with GitHub.

Over the last few posts, I’ve shown how to create and use the GutHub website for managing repositories. I’ve found that every so often when working with GitHub, I need to delete a repository. This is fairly simple to do, but only delete ones which you are sure are no longer needed, as there is no undo delete function.

To delete a repository, load it on the GitHub website and click the Settings button:

Repository webpage

Continue reading “ClassicPress Development with GitHub: Delete Repository”

Rewrite domain on Linux hosting to redirect one domain to another

Linux HostingI transitioned from a Windows based host to a Linux based one last year when I changed web host. I had a reasonable understanding of redirecting one domain to another on the Windows host, but am now having to learn how to do it on Linux hosting.

I’ve tried doing it through the front-end cPanel controls, but find that it enver works. The most recent one I;’ve tried setting up, I spoke to the support team and they gave me the .htaccess settings for the redirect.

I am posting it here so that I can easily find it in future.

I was wanting a redirect from https://dev.azrcrv.co.uk/ to https://development.azurecurve.co.uk/ to make short URLs available (or at least shorter URLs available). The below needs to be added to the .htaccess of the website on the domain you want to redirect:

#Redirect from old domain to new domain
RewriteEngine on
RewriteBase /
RewriteRule (.*) https://development.azurecurve.co.uk/$1 [R=301,L]

Replace the highlighted domain with the one you want to redirect.

Install Dynamics GP Web Services from the command line

Microsoft Dynamics GPI was giving a colleague a hand with a Microsoft Dynamics GP 2018 R2 upgrade recently (the client didn’t want to upgrade to the very latest version) and we encountered a problem with the installation of the Web Services:

Clr method invocation failed

Setup.exe .NET Framework Error

Clr method invocation failed

Continue reading “Install Dynamics GP Web Services from the command line”

Error loading Hyper-V Virtual Machine Connections

Hyper-VI’ve been using Hyper-V for quite a while and have always just accessed a running VM from the Hyper-V Manager, but you can also use the Virtual Machine Connection. Or you can, in theory, but when you click the drop-down for Virtual Machine you see an error instead of a list of the available virtual machines:

Virtual Machine Connection showing 'error loading virtual machines'

Continue reading “Error loading Hyper-V Virtual Machine Connections”

Run escalated PowerShell script from a batch file

PowerShellI posted a Power Shell snippet a while ago on bypassing the execution policy. More recently I needed to combine that with running a script with administrator permissions. I did a little exploring and found an article by Adam Dimech which contained this code which can be run from a batch file:

Change the highlighted section to your saved ps1 file and you can run that script escalated with administrator permissions.

PowerShell  -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""{path and filename of ps1 file}""' -Verb RunAs}"

Stored procedure to get next Dynamics GP Payables Voucher Number

Microsoft Dynamics GPI’ve previously posted SQL stored procedures to get the next GL Journal Number and the next PO Receipt number and today it is the turn of a stored procedure to get the next PM Voucher Number.

The stored procedure will call the eConnect stored procedure which gets the next number and increments the stored value. This code was written so I could easily call it from VBA in Integration Manager for an integration which needed to insert some data into a custom table. This allowed me to get the voucher number up front and use it in the VBA.

-- drop stored proc if it exists
IF OBJECT_ID(N'usp_AZRCRV_GetNextPMVoucherNumber', N'P') IS NOT NULL
    DROP PROCEDURE usp_AZRCRV_GetNextPMVoucherNumber
GO
-- create stored proc
CREATE PROCEDURE usp_AZRCRV_GetNextPMVoucherNumber AS
/*
Created by Ian Grieve of azurecurve|Ramblings of a Dynamics GP Consultant (https://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales (CC BY-NC-SA 2.0 UK).
*/
BEGIN
	DECLARE @return_value AS INT
	DECLARE @O_vCNTRLNUM AS VARCHAR(17)
	DECLARE @I_sCNTRLTYP AS TINYINT = 0
	DECLARE @O_iErrorState AS INT

	EXEC @return_value = taGetPMNextVoucherNumber
				@I_sCNTRLTYP = @I_sCNTRLTYP
				,@O_iErrorState = @O_iErrorState OUTPUT
				,@O_vCNTRLNUM = @O_vCNTRLNUM OUTPUT
	SELECT @O_vCNTRLNUM AS VCHRNMBR
END
GO

-- grant execute permission on stored proc to DYNGRP
GRANT EXECUTE ON usp_AZRCRV_GetNextPMVoucherNumber TO DYNGRP
GO

The stored procedure can be executed using this command:

-- execute stored proc
EXEC usp_AZRCRV_GetNextPMVoucherNumber
GO

ClassicPress Development with GitHub: Commit Files

GitHubWhen I started developing plugins for ClassicPress I decided that I needed to be using source control. As ClassicPress is intending to use GitHub for their plugin directory, it made sense for me to use it as well. This post is part of a series on ClassicPress Development with GitHub.

With a repository created, we can now upload the existing project files. Do this by visiting the repository page and click the Upload files button:

GitHub repository page

Continue reading “ClassicPress Development with GitHub: Commit Files”

ClassicPress Development with GitHub: Create Repository

GitHubWhen I started developing plugins for ClassicPress I decided that I needed to be using source control. As ClassicPress is intending to use GitHub for their plugin directory, it made sense for me to use it as well. This post is part of a series on ClassicPress Development with GitHub.

With us now signed up for GitHub, we can create our first repository. From your dashboard (which is https://github.com/ followed by your username), click the New repository button:

Create a new repository on GitHub

Continue reading “ClassicPress Development with GitHub: Create Repository”